|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.ibm.wbi.Proxy
The main component of the pluggable transforming proxy framework. This component connects and manages all components and Sublayers.
| Field Summary | |
static java.lang.String |
COPYRIGHT
The IBM copyright information. |
static int |
ERROR
Indicates an error return code. |
static java.lang.String |
HOME_PROPERTY
|
static int |
NOERROR
Indicates a no error return code. |
static java.lang.String |
PRODUCT
|
static java.lang.String |
RELEASE
|
protected static com.ibm.wbi.TransactionTracingHandler |
tracingHandler
Reference to the transaction tracing handler. |
static java.lang.String |
VERSION
|
| Constructor Summary | |
Proxy()
Construct a new pluggable transforming proxy. |
|
| Method Summary | |
void |
abort()
Abort abruptly shuts down the proxy without gracefully cleaning up. |
void |
addPlugin(Plugin plugin,
java.util.Properties attributes,
boolean enabled)
Transiently adds a Plugin to this instance of the Proxy (this does not install the Plugin into the configuration store). |
void |
deregisterAllSublayers()
Deregister all registered sublayers (and all their associated components). |
void |
deregisterSublayer(com.ibm.wbi.Sublayer sublayer)
Deregister a Sublayer (and all it's associated components). |
static java.lang.String |
getInstallPath()
Get the system install path. |
static java.util.Enumeration |
getInstances()
Determine the list of running Proxies in the current virtual machine. |
static java.lang.String |
getNativePath()
Get the path for the native code. |
static Proxy |
getNewestInstance()
Determine the newest instance of Proxy that has been created. |
Plugin |
getPlugin(java.lang.String installname)
Get the plugin by its install name |
Plugin[] |
getPlugins()
Get an array of Plugins currently registered in the Proxy. |
com.ibm.wbi.RequestDescriptor[] |
getRequests()
Get an array of descriptors that can be used to inquire about the requests currently being serviced by the Proxy. |
com.ibm.wbi.Sublayer |
getSublayer(java.lang.Integer identity)
Get the Sublayer that produces the the specified identity. |
java.lang.Integer[] |
getSublayerIdentities()
Get an array of all registered Sublayer identities. |
com.ibm.wbi.Sublayer[] |
getSublayers()
Get an array of registered Sublayers. |
static SystemContext |
getSystemContext()
Get the SystemContext. |
static com.ibm.wbi.TransactionTracingHandler |
getTransactionTracingHandler()
Get a reference to the tracing handler. |
boolean |
initialize(SystemContext context)
Initialize the proxy loading the Sublayers and registered
Plugins. |
boolean |
initialize(SystemContext context,
boolean loadSublayers,
boolean loadPlugins)
Initialize the proxy for receiving requests. |
void |
installPlugin(com.ibm.wbi.PluginDescriptor pd)
Install a Plugin as specified by the descriptor |
void |
installPluginFromRegistryFile(java.lang.String registryFile)
Install a Plugin as specified in the Registry File. |
protected void |
loadSublayersFromConfigurationStore()
Loads the sublayers that are specified in the configuration store. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
|
void |
registerSublayer(com.ibm.wbi.Sublayer sublayer)
Register the specified Sublayer (and all it's associate components). |
void |
reloadPlugins()
Reload the plugins, this re-builds the condition trees on the MEGs. |
void |
removePlugin(Plugin plugin)
Transiently removes a Plugin from this instance of the Proxy (this does not uninstall the Plugin from the configuration store). |
boolean |
restart()
Restart the transproxy without waiting for pending requests. |
boolean |
restart(int timeout)
Restart the transproxy waiting for pending requests for the specified time. |
boolean |
restart(int timeout,
boolean loadSublayers,
boolean loadPlugins)
Restart the transproxy waiting for pending requests for the specified time. |
void |
resume()
Resume the registered Sublayers to accepting requests. |
protected void |
startSublayers()
|
void |
suspend()
Suspend the registered Sublayers from accepting any more requests after this call. |
boolean |
terminate()
Terminate attempts to gracefully take each component of the proxy down and remove all reference links without waiting for pending requests. |
boolean |
terminate(int wait)
Terminate attempts to gracefully take each component of the proxy down and remove all reference links. |
static void |
throttle()
This method blocks until the Proxy is "unthrottled". |
void |
uninstallAllPlugins()
Uninstall all the Plugins. |
void |
uninstallPlugin(java.lang.String fullyQualifiedClassName)
Uninstall the Plugin with the specified class name. |
| Field Detail |
public static java.lang.String PRODUCT
public static java.lang.String RELEASE
public static java.lang.String VERSION
public static final java.lang.String HOME_PROPERTY
public static final java.lang.String COPYRIGHT
public static final int NOERROR
public static final int ERROR
protected static com.ibm.wbi.TransactionTracingHandler tracingHandler
| Constructor Detail |
public Proxy()
| Method Detail |
public static Proxy getNewestInstance()
null
if no instances have been created in the current virtual
machine.public static java.util.Enumeration getInstances()
public static java.lang.String getInstallPath()
public static java.lang.String getNativePath()
Get the path for the native code. WBI can be combined with native code. This method determines the path of the directory that contains the native code. The result of this method depends on the operating system and architecture the current Java process is running on.
In general the directories for native code are located in the bin
directory under the WBI root (install) directory. The name of such a
directory is based on the name of the operating system and its
underlying architecture.
Examples:
Assume you are running the operating system Linux on a standard PC. The name of the directory will then be
x86_Linuxand is located in <WBI_rootdirectory>/bin. White spaces in the operating system name are replaced with underscores "_".
Note: If the operating system is Windows 95/98/NT/2000 and the underlying architecture is a standard PC, the native directory is
x86_win32instead of x86_Windows* due to the fact that these operating systems share the same architecture.
This method should be called by each plugin that uses native code in
order to determine the right native directory. Using this method
maintains platform independency.
You simply load a native library by using the following statements:
String dllName = ...
File dllFile = new File( Proxy.getNativePath(), dllName );
System.load( dllFile.getAbsolutePath() );
This allows you Java code for a WBI plugin to be platform independent.
Make sure that your plugin handles the situation if there is not native
library for a particular platform, e.g. do not use the functionality of
the native library or disable the respective plugin.
public static SystemContext getSystemContext()
public void reloadPlugins()
public boolean initialize(SystemContext context)
Sublayers and registered
Plugins.context - The SystemContext that contains all
the initialized resources for the transproxy.true if successfully initialized; else false.
public boolean initialize(SystemContext context,
boolean loadSublayers,
boolean loadPlugins)
context - The SystemContext that contains
all the initialized resources for the
transproxy.loadSublayers - true if Sublayers should be
loaded from configuration store; else
false.loadPlugins - true if Plugins should be
loaded from configuration store; else
false.true if proxy loaded without any errors.public void abort()
public boolean terminate()
true if terminated with all requests serviced;
false if pending requests left when terminated.public boolean terminate(int wait)
wait - The amount of time to wait for pending requests.true if terminated with all requests serviced;
false if pending requests left when terminated.public boolean restart()
true if terminated with all requests serviced;
false if pending requests left when terminated.public boolean restart(int timeout)
wait - The amount of time to wait for pending requests.true if terminated with all requests serviced;
false if pending requests left when terminated.
public boolean restart(int timeout,
boolean loadSublayers,
boolean loadPlugins)
wait - The amount of time to wait for pending requests.loadSublayers - true if Sublayers should be
loaded from configuration store; else
false.loadPlugins - true if Plugins should be
loaded from configuration store; else
false.true if terminated with all requests serviced;
false if pending requests left when terminated.public void suspend()
public void resume()
public static void throttle()
public com.ibm.wbi.RequestDescriptor[] getRequests()
public Plugin[] getPlugins()
public Plugin getPlugin(java.lang.String installname)
installname - Full name of plugin (e.g., "ibm/test")
public void addPlugin(Plugin plugin,
java.util.Properties attributes,
boolean enabled)
throws com.ibm.wbi.PluginException
attributes must be specified.
plugin - The Plugin to register.attributes - The Plugin attributes.enabled - true if enabled, else
false.com.ibm.wbi.PluginException - If an error occurs.
public void removePlugin(Plugin plugin)
throws com.ibm.wbi.PluginException
plugin - The Plugin to remove.com.ibm.wbi.PluginException - If an error occurs.
public void installPluginFromRegistryFile(java.lang.String registryFile)
throws com.ibm.wbi.PluginInstallException,
java.io.IOException
registryFile - The Plugin Registry File.com.ibm.wbi.PluginInstallException - If an error occurs.java.io.IOException - If problems while reading registry file (e.g. FileNotFoundException)
public void installPlugin(com.ibm.wbi.PluginDescriptor pd)
throws com.ibm.wbi.PluginInstallException
pd - The Plugin Descriptorcom.ibm.wbi.PluginInstallException - If an error occurs.
public void uninstallPlugin(java.lang.String fullyQualifiedClassName)
throws com.ibm.wbi.PluginInstallException
fullyQualifiedClassName - The class name.com.ibm.wbi.PluginInstallException - If an error occurs.
public void uninstallAllPlugins()
throws com.ibm.wbi.PluginInstallException
com.ibm.wbi.PluginInstallException - If an error occurs.
public void registerSublayer(com.ibm.wbi.Sublayer sublayer)
throws com.ibm.wbi.SublayerException,
java.lang.Exception
start() method on the Sublayer to begin
processing requests.sublayer - The Sublayer to register.com.ibm.wbi.SublayerException - If an error occurs registering the
Sublayer.java.lang.Exception - If problems while starting the sublayer
public void deregisterSublayer(com.ibm.wbi.Sublayer sublayer)
throws com.ibm.wbi.SublayerException,
java.lang.Exception
stop() method on the Sublayer to stop
processing requests. The method will block for maximum of 30 seconds
to service all requests associated with the Sublayer.sublayer - The Sublayer to deregister.com.ibm.wbi.SublayerException - If an error occurs deregistering the
Sublayer.java.lang.Exception - If problems while stopping the sublayer. Note
that it is removed from the registry regardless.
public void deregisterAllSublayers()
throws java.lang.Exception
stop() method on
the Sublayer to stop processing requests.java.lang.Exception - If problems while stopping any sublayer. Note
that they are removed from the registry regardless.public java.lang.Integer[] getSublayerIdentities()
public com.ibm.wbi.Sublayer[] getSublayers()
public com.ibm.wbi.Sublayer getSublayer(java.lang.Integer identity)
throws com.ibm.wbi.SublayerException
identity - The Sublayer identity.com.ibm.wbi.SublayerException - If the Sublayer does not exist.public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerprotected void loadSublayersFromConfigurationStore()
protected void startSublayers()
throws java.lang.Exception
public static com.ibm.wbi.TransactionTracingHandler getTransactionTracingHandler()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||