xmlBlaster 2.1.0 API

org.xmlBlaster.j2ee.util
Class GlobalUtil

java.lang.Object
  extended by org.xmlBlaster.j2ee.util.GlobalUtil
All Implemented Interfaces:
java.io.Serializable

public class GlobalUtil
extends java.lang.Object
implements java.io.Serializable

A Global helper class to make it easier to work with Global in an embedded J2EE environment.

The helper may be used in two major ways: created standalone, or looked up through JNDI. When looked up trough JNDI it might be possible to have access to the engine.Global if accessed in the same VM as the engine.

Version:
$Revision: 1.2 $
Author:
Peter Antman
See Also:
Serialized Form

Field Summary
private  ServerScope engineGlobal
           
private static long serialVersionUID
           
 
Constructor Summary
GlobalUtil()
          Create a utility class without any engine global.
GlobalUtil(ServerScope engineGlobal)
          Create a utility class with access to engine global, use this to bind into jndi.
 
Method Summary
 void addArguments(Global glob, java.util.Properties props)
          Ad arguments found in props to the global.
 void addEngineProperties(Global glob)
          Set the properties from the serverside engine global in the given global if it exists.
 void addServerProperties(Global glob)
          Ad typical properties needed to run embedded in a J2EE/JBoss server.
 Global getClone(Global global)
          Clone the given Global, check if it contains a ServerNode, or set this engineGlobal if not null as ServerNode.
 void loadPropertyFile(Global glob, java.lang.String propFile)
          Load properties from propertyFile into global.
 Global newGlobal(java.lang.String propertyFileName, java.util.Properties args)
          Create a new Global without any automatic background loading of xmlBlaster.properties.
 void setupSecurityManager(Global glob)
          Check and possibly setup a security manager if an RMI driver is loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

engineGlobal

private transient ServerScope engineGlobal
Constructor Detail

GlobalUtil

public GlobalUtil()
Create a utility class without any engine global.


GlobalUtil

public GlobalUtil(ServerScope engineGlobal)
Create a utility class with access to engine global, use this to bind into jndi.

Method Detail

newGlobal

public Global newGlobal(java.lang.String propertyFileName,
                        java.util.Properties args)
                 throws java.lang.IllegalStateException
Create a new Global without any automatic background loading of xmlBlaster.properties.

if engineGlobal is available, its set as a ServerNode.

This Global will be setup to be used in a server environment.

if an engine global exists, the properties from that one will be set first in the created Global.

Throws:
java.lang.IllegalStateException

addEngineProperties

public void addEngineProperties(Global glob)
                         throws java.lang.IllegalStateException
Set the properties from the serverside engine global in the given global if it exists.

Throws:
java.lang.IllegalStateException

getClone

public Global getClone(Global global)
Clone the given Global, check if it contains a ServerNode, or set this engineGlobal if not null as ServerNode.


loadPropertyFile

public void loadPropertyFile(Global glob,
                             java.lang.String propFile)
                      throws java.lang.IllegalStateException
Load properties from propertyFile into global.

The property file is first looked up the the context classpath, next the xmlBlaster lookup algorithm is used.

The global is returned as is, that means that any properties found in propertyFile, such as logging, is ignored until a cloned copy of the global is retained.

Throws:
java.lang.IllegalStateException

addArguments

public void addArguments(Global glob,
                         java.util.Properties props)
                  throws java.lang.IllegalStateException
Ad arguments found in props to the global.

The global is returned as is, that means that any properties found in props, such as logging, is ignored until a cloned copy of the global is retained.

Throws:
java.lang.IllegalStateException

addServerProperties

public void addServerProperties(Global glob)
                         throws java.lang.IllegalStateException
Ad typical properties needed to run embedded in a J2EE/JBoss server.

Throws:
java.lang.IllegalStateException

setupSecurityManager

public void setupSecurityManager(Global glob)
                          throws java.lang.SecurityException
Check and possibly setup a security manager if an RMI driver is loaded.

Throws:
java.lang.SecurityException

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.