|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.Global
public class Global
Global variables to avoid singleton.
Each Global instance holds all configuration and helper objects for exactly one XmlBlasterAccess client instance. It is like a local stack for a connection.
Use one instance of this for each XmlBlasterAccess client connection to xmlBlaster.
A Global instance is still usable after a call to its shutdown() method, it can be used again in another XmlBlasterAccess instance.
org.xmlBlaster.test.classtest.GlobalTest
Field Summary | |
---|---|
protected java.lang.String |
addressNormalized
|
protected Address |
bootstrapAddress
|
protected Timeout |
burstModeTimer
|
protected java.lang.String |
cbHostname
|
protected CbServerPluginManager |
cbServerPluginManager
|
protected I_Checkpoint |
checkpointPlugin
Must be loaded in runlevel 0 or 1 before any access as not synchronized |
protected PluginLoader |
clientSecurityLoader
|
protected I_ConnectQosFactory |
connectQosFactory
|
protected ContextNode |
contextNode
|
protected static int |
counter
|
protected I_DisconnectQosFactory |
disconnectQosFactory
|
protected DispatchPluginManager |
dispatchPluginManager
|
protected DispatchWorkerPool |
dispatchWorkerPool
|
protected javax.xml.parsers.DocumentBuilderFactory |
docBuilderFactory
|
protected I_EntryFactory |
entryFactory
|
protected java.lang.String |
errorText
|
static long |
heapMemoryUsage
Number of bytes this JVM can allocate max, the -Xmx???M setting Set by JmxWrappter.java (defaults to Runtime.getRuntime().maxMemory()) |
protected java.lang.String |
id
|
protected java.lang.String |
ip_addr
|
protected boolean |
isDoingShutdown
|
protected Timeout |
jdbcConnectionPoolTimer
|
protected java.util.Hashtable |
logChannels
|
static long |
maxFileDescriptorCount
The max number of file descriptors this JVM may use Set by JmxWrappter.java, else 0 |
protected java.lang.String |
ME
|
protected Timeout |
messageTimer
|
protected I_MsgKeyFactory |
msgKeyFactory
|
protected I_MsgQosFactory |
msgQosFactory
|
protected java.util.Map |
nativeCallbackDriverMap
|
protected java.util.Map |
objectMap
Store objects in the scope of one client connection or server instance |
java.lang.Object |
objectMapMonitor
Helper to synchronize objectMap access |
protected I_TimeoutManager |
pingTimer
|
protected Property |
property
|
protected ProtocolPluginManager |
protocolPluginManager
|
protected I_QueryKeyFactory |
queryKeyFactory
|
protected I_QueryQosFactory |
queryQosFactory
|
protected QueuePluginManager |
queuePluginManager
|
protected javax.xml.parsers.SAXParserFactory |
saxFactory
|
protected ContextNode |
scopeContextNode
|
protected long |
sequenceNumber
JMX notification sequence number. |
protected I_StatusQosFactory |
statusQosFactory
|
static long |
totalPhysicalMemorySize
The amount of physical RAM of this machine. |
protected boolean |
wipeOutDB
set to allow wipe out the persistence on restarts |
protected I_XmlBlasterAccess |
xmlBlasterAccess
The client handle to access xmlBlaster |
Constructor Summary | |
---|---|
Global()
Constructs an initial Global object, same as Global(null, true, true) |
|
Global(java.util.Properties props)
Constructs an initial Global object which is initialized by your properties (without leading '-'), same as Global(args, true, true) |
|
Global(java.lang.String[] args)
Constructs an initial Global object which is initialized by your args array (usually the command line args). |
|
Global(java.lang.String[] args,
boolean loadPropFile,
boolean checkInstance)
|
|
Global(java.lang.String[] args,
boolean loadPropFile,
boolean checkInstance,
boolean doReplace)
Constructs an initial Global object which is initialized by your args array (usually the command line args). |
Method Summary | |
---|---|
java.lang.String |
accessFromInternalHttpServer(Address address,
java.lang.String urlPath,
boolean verbose)
Access the xmlBlaster internal HTTP server and download the requested path. |
void |
addNativeCallbackDriver(java.lang.String key,
org.xmlBlaster.protocol.I_CallbackDriver driver)
The key is the protocol and the address to access the callback instance. |
void |
addObjectEntry(java.lang.String key,
java.lang.Object driver)
Add an object in the scope of an I_XmlBlasterAccess or of one cluster node. |
static java.lang.String |
byteString(long size)
Build a nice, human readable string for the size in MB/KB/Bytes. |
java.util.logging.Level |
changeLogLevel(java.lang.String loggerName,
java.util.logging.Level level)
Changes the given logger to given level. |
protected java.lang.Object |
clone()
Get a deep clone (everything is independent from the origin). |
DispatchConnectionsHandler |
createClientDispatchConnectionsHandler(ClientDispatchManager dispatchManager)
Returns the client access layer implementations 'ClientDispatchConnectionsHandler' |
static java.lang.String |
decode(java.lang.String s,
java.lang.String enc)
This notation is URLDecoder since JDK 1.4. |
void |
doStorageCleanup(JdbcQueue jdbcQueue)
|
static java.lang.String |
encode(java.lang.String s,
java.lang.String enc)
This notation is URLEncoder since JDK 1.4. |
void |
finalize()
|
static void |
gc(int numGc,
long sleep)
Do some garbage collect attempts |
boolean |
get(java.lang.String shortKey,
boolean defaultValue,
java.util.Properties map,
I_PluginConfig pluginConfig)
Checks PluginInfo as well. |
double |
get(java.lang.String shortKey,
double defaultValue,
java.util.Properties map,
I_PluginConfig pluginConfig)
|
int |
get(java.lang.String shortKey,
int defaultValue,
java.util.Properties map,
I_PluginConfig pluginConfig)
|
long |
get(java.lang.String shortKey,
long defaultValue,
java.util.Properties map,
I_PluginConfig pluginConfig)
|
java.lang.String |
get(java.lang.String shortKey,
java.lang.String defaultValue,
java.util.Properties map,
I_PluginConfig pluginConfig)
It searches for the given property. |
Address |
getBootstrapAddress()
Returns the address of the xmlBlaster internal http server. |
java.lang.String |
getBuildJavaVendor()
|
java.lang.String |
getBuildJavaVersion()
|
java.lang.String |
getBuildTimestamp()
See @build.timestamp@ which will be replaced by build.xml with the current timestamp |
Timeout |
getBurstModeTimer()
Access the handle of the burst mode timer thread. |
java.lang.String |
getCbHostname()
Returns a local IP or bootstrapHostname as a default setting to use for callback servers. |
java.lang.String |
getCbHostname(java.lang.String hostname,
int port)
Returns a local IP as a default setting to use for callback servers. |
CbServerPluginManager |
getCbServerPluginManager()
Access the handle of the burst mode timer thread. |
I_Checkpoint |
getCheckpointPlugin()
|
ClassLoaderFactory |
getClassLoaderFactory()
Access the xmlBlaster Classloader. |
PluginLoader |
getClientSecurityPluginLoader()
Needed by java client helper classes to load the security plugin |
Global |
getClone(java.lang.String[] args)
Get a cloned instance. |
I_ConnectQosFactory |
getConnectQosFactory()
Return a factory parsing QoS XML strings from connect() and connect-return messages. |
ContextNode |
getContextNode()
The unique name of this instance. |
static int |
getCounter()
|
java.lang.String |
getDatabaseNodeStr()
|
I_DisconnectQosFactory |
getDisconnectQosFactory()
Return a factory parsing QoS XML strings from disconnect() requests. |
DispatchPluginManager |
getDispatchPluginManager()
|
DispatchWorkerPool |
getDispatchWorkerPool()
Access the handle of the callback thread pool. |
javax.xml.parsers.DocumentBuilderFactory |
getDocumentBuilderFactory()
Get the configured DocumentBuilderFactoryFactory. |
I_EntryFactory |
getEntryFactory()
The factory creating queue or msgUnitStore entries from persistent store. |
java.lang.String |
getErrorText()
|
static byte[] |
getFromClasspath(java.lang.String file,
java.lang.Object location)
Access a file from the CLASSPATH, typically from xmlBlaster.jar It is searched in the directory of the package of the calling java class org.xmlBlaster.util.http => org/xmlBlaster/util/http |
java.lang.Object |
getFromWeakRegistry(java.lang.Object key)
|
HttpIORServer |
getHttpServer()
Access the http server which allows bootstrapping the CORBA IOR |
java.lang.String |
getId()
Access the unique local id (as a String), on client side typically the loginName with the public sessionId, on server side the server instance unique id. |
java.lang.String |
getInstanceId()
Unique id of the client, changes on each restart. |
static java.lang.String |
getJavadocUrl(java.lang.String className,
java.lang.String methodName)
http://www.xmlblaster.org/xmlBlaster/doc/api/org/xmlBlaster/util/admin/I_AdminPop3Driver.html#setPollingInterval(long) |
Timeout |
getJdbcConnectionPoolTimer()
Access the handle of the jdbcConnectionPool timer (the timer for the polling when the connection has been lost). |
static java.lang.String |
getJmxUsageLinkInfo(java.lang.String className,
java.lang.String methodName)
http://www.xmlblaster.org/xmlBlaster/doc/api/org/xmlBlaster/util/admin/I_AdminPop3Driver.html#setPollingInterval(long) |
JmxWrapper |
getJmxWrapper()
|
java.lang.String |
getLocalIP()
The IP address where we are running. |
java.util.logging.Level |
getLogLevel(java.lang.String loggerName)
Get the current loglevel. |
java.lang.String |
getLogPrefix()
Is coded in derived engine.Global |
java.lang.String |
getLogPrefixDashed()
Is coded in derived engine.Global |
static java.lang.String |
getMemoryStatistic()
Access a nice, human readable string with the current RAM memory situation. |
Timeout |
getMessageTimer()
Access the handle of the message expiry timer thread. |
I_MsgKeyFactory |
getMsgKeyFactory()
Return a factory parsing key XML strings from publish() and update() messages. |
I_MsgQosFactory |
getMsgQosFactory()
Return a factory parsing QoS XML strings from publish() and update() messages. |
org.xmlBlaster.protocol.I_CallbackDriver |
getNativeCallbackDriver(java.lang.String key)
The key is the protocol and the address to access the callback instance. |
java.lang.String[] |
getNativeConnectArgs()
Convenience method which returns the typical environment settings for a LOCAL connection. |
NodeId |
getNodeId()
|
java.lang.Object |
getObjectEntry(java.lang.String key)
Get an object in the scope of an xmlBlaster client connection or of one cluster node. |
java.util.Map |
getPersistentMap(java.lang.String id)
Returns a persistent map. |
I_TimeoutManager |
getPingTimer()
Access the handle of the ping timer thread to test a client or callback connection. |
PluginManagerBase |
getPluginManager()
Returns the plugin manager used by the run level manager. |
PluginRegistry |
getPluginRegistry()
Returns the plugin registry. |
Property |
getProperty()
Access the environment properties, is never null. |
ProtocolPluginManager |
getProtocolPluginManager()
Access the handle of the burst mode timer thread. |
I_QueryKeyFactory |
getQueryKeyFactory()
Return a factory parsing key XML strings from subscribe() and other query invocations. |
I_QueryQosFactory |
getQueryQosFactory()
Return a factory parsing QoS XML strings from publish() and update() messages. |
QueuePluginManager |
getQueuePluginManager()
|
java.lang.String |
getReleaseId()
Combination from getVersion() and getRevisionNumber(). |
java.lang.String |
getRevisionNumber()
See @revision.number@ which will be replaced by build.xml with the current subversion revision |
int |
getRunlevel()
|
javax.xml.parsers.SAXParserFactory |
getSAXParserFactory()
Get the configured SAXParserFactory. |
ContextNode |
getScopeContextNode()
Helper for the time being to be used on client side by services like SmtpClient. |
static java.lang.String |
getStackTraceAsString(java.lang.Throwable ex)
Prints the stack trace as a String so it can be put on the normal logs. |
I_StatusQosFactory |
getStatusQosFactory()
Return a factory parsing QoS XML strings from subcribe(), unSubscribe() and erase() returns. |
java.lang.String |
getStrippedId()
Same as getId() but all 'special characters' are stripped so you can use it for file names. |
static java.lang.String |
getStrippedString(java.lang.String text)
Utility method to strip any string, all characters which prevent to be used for e.g. |
java.lang.String |
getVersion()
See @version@ which will be replaced by build.xml with the current version |
boolean |
getWipeOutDB()
Tells the jdbc queue manager if a cleanup of the DB is necessary |
I_XmlBlasterAccess |
getXmlBlasterAccess()
The client handle to access xmlBlaster remotely. |
int |
init(java.applet.Applet applet)
|
int |
init(java.util.Map props)
Calls init(String[] args), the props keys have no leading "-". |
int |
init(java.lang.String[] args)
The args key needs a leading "-". |
protected void |
initId()
Our identifier, the cluster node we want connect to |
static Global |
instance()
Global access to the default 'global' instance. |
boolean |
isJmxActivated()
Check if JMX is activated. |
boolean |
isRegisteredMBean(ContextNode ctxNode)
|
boolean |
isServerSide()
Check where we are, on client or on server side? engine.Global overwrites this |
static java.lang.String |
logUsage()
|
static void |
main(java.lang.String[] args)
To play with a profiling tool |
java.lang.String[] |
peekQueueMessagesToFile(I_Queue queue,
int numOfEntries,
java.lang.String path,
java.lang.String label)
Dumps given amount of messages from queue to file. |
void |
putInWeakRegistry(java.lang.Object key,
java.lang.Object value)
|
JmxMBeanHandle |
registerMBean(ContextNode contextNode,
java.lang.Object mbean)
JMX support. |
java.lang.Object |
removeFromWeakRegistry(java.lang.Object key)
|
void |
removeNativeCallbackDriver(java.lang.String key)
The key is the protocol and the address to access the callback instance. |
void |
removeObjectEntry(java.lang.String key)
Remove an object from the scope of an I_XmlBlasterAccess or of one cluster node. |
void |
resetInstanceId()
Reset the cached instance id |
void |
sendNotification(javax.management.NotificationBroadcasterSupport source,
java.lang.String msg,
java.lang.String attributeName,
java.lang.String attributeType,
java.lang.Object oldValue,
java.lang.Object newValue)
Send an administrative notification. |
void |
setBootstrapAddress(Address address)
Force to use the given bootstrap address, used for cluster connections |
void |
setCheckpointPlugin(I_Checkpoint checkpointPlugin)
|
void |
setContextNode(ContextNode contextNode)
The unique name of this instance. |
void |
setId(java.lang.String id)
Currently set by enging.Global, used server side only. |
void |
setScopeContextNode(ContextNode contextNode)
|
void |
setWipeOutDB(boolean doWipeout)
Tells the queue manager it should remove all entries from the persisence. |
protected void |
shallowCopy(Global utilGlob)
|
void |
shutdown()
|
void |
shutdownHttpServer()
|
boolean |
supportJmx()
|
void |
unregisterMBean(java.lang.Object objectName)
Unregister a JMX MBean. |
java.lang.String |
usage()
Command line usage. |
java.lang.String |
validateJmxValue(java.lang.String value)
|
static int |
waitOnKeyboardHit(java.lang.String str)
Blocks until a key on the keyboard is hit. |
boolean |
wantsHelp()
Allows you to query if user wants help. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static long totalPhysicalMemorySize
public static long heapMemoryUsage
public static long maxFileDescriptorCount
protected java.lang.String ME
protected java.lang.String ip_addr
protected java.lang.String id
protected volatile Property property
protected java.lang.String errorText
protected ContextNode contextNode
protected ContextNode scopeContextNode
protected java.lang.String cbHostname
protected java.lang.String addressNormalized
protected java.util.Map nativeCallbackDriverMap
protected java.util.Map objectMap
public final java.lang.Object objectMapMonitor
protected volatile Address bootstrapAddress
protected PluginLoader clientSecurityLoader
protected volatile QueuePluginManager queuePluginManager
protected volatile DispatchPluginManager dispatchPluginManager
protected volatile ProtocolPluginManager protocolPluginManager
protected volatile CbServerPluginManager cbServerPluginManager
protected java.util.Hashtable logChannels
protected javax.xml.parsers.SAXParserFactory saxFactory
protected javax.xml.parsers.DocumentBuilderFactory docBuilderFactory
protected I_Checkpoint checkpointPlugin
protected volatile I_MsgKeyFactory msgKeyFactory
protected volatile I_QueryKeyFactory queryKeyFactory
protected volatile I_ConnectQosFactory connectQosFactory
protected volatile I_DisconnectQosFactory disconnectQosFactory
protected volatile I_MsgQosFactory msgQosFactory
protected volatile I_QueryQosFactory queryQosFactory
protected volatile I_StatusQosFactory statusQosFactory
protected volatile I_TimeoutManager pingTimer
protected volatile Timeout burstModeTimer
protected volatile Timeout messageTimer
protected volatile Timeout jdbcConnectionPoolTimer
protected volatile DispatchWorkerPool dispatchWorkerPool
protected static int counter
protected volatile I_XmlBlasterAccess xmlBlasterAccess
protected boolean isDoingShutdown
protected boolean wipeOutDB
protected I_EntryFactory entryFactory
protected long sequenceNumber
Constructor Detail |
---|
public Global()
public Global(java.util.Properties props)
public Global(java.lang.String[] args)
public Global(java.lang.String[] args, boolean loadPropFile, boolean checkInstance)
public Global(java.lang.String[] args, boolean loadPropFile, boolean checkInstance, boolean doReplace)
By setting loadPropFile to false it is possible to create a Global which does not automatically search out the xmlBlaster.properties file, which is good when you want to start xmlBlaster in an embedded environment.
It is possible to later load the property file if one wants, here is one way to do it:
Property p = glob.getProperty(); Properties prop = new Properties(); FileInfo i = p.findPath("xmlBlaster.properties"); InputStream is = i.getInputStream(); prop.load(is); String[] ar = Property.propsToArgs(prop); p.addArgs2Props( ar != null ? ar : new String[0] );
It is also possible to load an entire second property file or find it with some other algorithm byte using the same pattern as above, just don't use findPath, but some other code.
args
- args array (usually the command line args).loadPropFile
- if automatic loading of xmlBlaster.properties should be done.Method Detail |
---|
public boolean supportJmx()
public static int getCounter()
public final JmxWrapper getJmxWrapper() throws XmlBlasterException
XmlBlasterException
public boolean isJmxActivated()
public void sendNotification(javax.management.NotificationBroadcasterSupport source, java.lang.String msg, java.lang.String attributeName, java.lang.String attributeType, java.lang.Object oldValue, java.lang.Object newValue)
public JmxMBeanHandle registerMBean(ContextNode contextNode, java.lang.Object mbean) throws XmlBlasterException
java -Dcom.sun.management.jmxremote org.xmlBlaster.Main
You can access xmlBlaster from 'jconsole' delivered with JDK1.5 or above.
The root node is always the cluster node id.
contextNode
- Used to retrieve a unique instance name for the given MBeanmbean
- the MBean object instance
XmlBlasterException
http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.jmx.html
public void unregisterMBean(java.lang.Object objectName)
objectName
- The object you got from registerMBean() of type ObjectName,
if null nothing happenspublic boolean isRegisteredMBean(ContextNode ctxNode) throws XmlBlasterException
XmlBlasterException
public java.lang.String getVersion()
public java.lang.String getRevisionNumber()
public java.lang.String getReleaseId()
public java.lang.String getBuildTimestamp()
public java.lang.String getBuildJavaVendor()
public java.lang.String getBuildJavaVersion()
public static int waitOnKeyboardHit(java.lang.String str)
str
- If not null it will be printed on console with System.out
protected void initId()
protected void shallowCopy(Global utilGlob)
public java.util.logging.Level getLogLevel(java.lang.String loggerName) throws XmlBlasterException
loggerName
- e.g. "logging" or "/node/heron/logging/org.xmlBlaster.util.Timestamp"
XmlBlasterException
public java.util.logging.Level changeLogLevel(java.lang.String loggerName, java.util.logging.Level level) throws XmlBlasterException
loggerName
- e.g. "logging" or "logging/org.xmlBlaster.util.StopWatch"level
- For example "FINE"
XmlBlasterException
- if your bool is strangepublic int init(java.util.Map props)
public int init(java.lang.String[] args)
public final boolean wantsHelp()
public java.lang.String getErrorText()
public int init(java.applet.Applet applet)
public ContextNode getContextNode()
public void setContextNode(ContextNode contextNode)
contextNode
- The new node idpublic ContextNode getScopeContextNode()
public void setScopeContextNode(ContextNode contextNode)
public void doStorageCleanup(JdbcQueue jdbcQueue)
public boolean isServerSide()
public NodeId getNodeId()
public java.lang.String getId()
public java.lang.String getStrippedId()
public java.lang.String getDatabaseNodeStr()
public static final java.lang.String getStrippedString(java.lang.String text)
This conversion is used for file names and for the administrative hierarchy e.g. "/node/heron/client/joe" is OK but 'http://xy:8080' instead of 'heron' is not
text
- e.g. "http://www.xmlBlaster.org:/home\\x"
public final java.lang.String validateJmxValue(java.lang.String value)
JmxWrapper.validateJmxValue(String)
public void setId(java.lang.String id)
a
- unique idpublic java.lang.String getLogPrefixDashed()
public java.lang.String getLogPrefix()
public static Global instance()
public static void main(String[] args) { new Global(args); ... } //later you can get this initialized instance with: Global glob = Global.instance(); ...
Note that you should avoid to use Global.instance() and preferably use the global which describes your current context, e.g. the specific client connection like xmlBlasterAccess.getGlobal(). Use global.getClone(String[]) to create a new Global instance.
public final Global getClone(java.lang.String[] args)
Calls clone() and sets the given args thereafter.
This is the preferred way to create a new and independent Global instance for example for another client connection.
Note that Global.instance() will return the original instance even if called on the cloned object (it's a static variable). You should avoid to use Global.instance()
args
- Additional configuration parametersprotected java.lang.Object clone()
clone
in class java.lang.Object
public final Property getProperty()
public I_Checkpoint getCheckpointPlugin()
public void setCheckpointPlugin(I_Checkpoint checkpointPlugin)
checkpointPlugin
- the checkpointPlugin to setpublic final I_MsgKeyFactory getMsgKeyFactory()
public final I_QueryKeyFactory getQueryKeyFactory()
public final I_ConnectQosFactory getConnectQosFactory()
public final I_DisconnectQosFactory getDisconnectQosFactory()
public final I_MsgQosFactory getMsgQosFactory()
public final I_QueryQosFactory getQueryQosFactory()
public final I_StatusQosFactory getStatusQosFactory()
public final org.xmlBlaster.protocol.I_CallbackDriver getNativeCallbackDriver(java.lang.String key)
key
- e.g. "SOCKET192.168.2.2:7604" from 'cbAddr.getType() + cbAddr.getRawAddress()'
public final void addNativeCallbackDriver(java.lang.String key, org.xmlBlaster.protocol.I_CallbackDriver driver)
key
- e.g. "SOCKET192.168.2.2:7604" from 'cbAddr.getType() + cbAddr.getRawAddress()'The
- instance of the protocol callback driverpublic final void removeNativeCallbackDriver(java.lang.String key)
key
- e.g. "SOCKET192.168.2.2:7604" from 'cbAddr.getType() + cbAddr.getRawAddress()'The
- instance of the protocol callback driverpublic final java.lang.Object getObjectEntry(java.lang.String key)
key
- e.g. "SOCKET192.168.2.2:7604" from 'cbAddr.getType() + cbAddr.getRawAddress()'public final void addObjectEntry(java.lang.String key, java.lang.Object driver)
key
- e.g. "SOCKET192.168.2.2:7604" from 'cbAddr.getType() + cbAddr.getRawAddress()'The
- instance of the protocol callback driverpublic final void removeObjectEntry(java.lang.String key)
key
- e.g. "SOCKET192.168.2.2:7604" from 'cbAddr.getType() + cbAddr.getRawAddress()'public final void setBootstrapAddress(Address address)
public final Address getBootstrapAddress()
-bootstrapHostname myhost.mycompany.com (or the raw IP) -bootstrapPort 3412Defaults to the local machine and the IANA xmlBlaster port.
public java.lang.String getCbHostname()
public java.lang.String getCbHostname(java.lang.String hostname, int port)
public java.lang.String accessFromInternalHttpServer(Address address, java.lang.String urlPath, boolean verbose) throws XmlBlasterException
address
- The address we want to connect to or nullurlPath
- The part after the host:port, from an URL "http://myhost.com:3412/AuthenticationService.ior"
urlPath is "AuthenticationService.ior"false
- Suppress error logging when server not found
XmlBlasterException
public final java.lang.String getLocalIP()
public final PluginLoader getClientSecurityPluginLoader()
public final QueuePluginManager getQueuePluginManager()
public final DispatchPluginManager getDispatchPluginManager()
public ClassLoaderFactory getClassLoaderFactory()
public final HttpIORServer getHttpServer() throws XmlBlasterException
XmlBlasterException
public final void shutdownHttpServer()
public javax.xml.parsers.SAXParserFactory getSAXParserFactory() throws XmlBlasterException
The implementation of the SAXParser factory is decided
by the property javax.xml.parsers.SAXParserFactory
if available in Global, otherwise the JDK1.4 default
org.apache.crimson.jaxp.SAXParserFactoryImpl
is returned.
The JDK 1.5 default would be
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
XmlBlasterException
getDocumentBuilderFactory()
public javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory() throws XmlBlasterException
The implementation of the DocumentBuilderFactory is decided by the property
javax.xml.parsers.DocumentBuilderFactory
if available in Global,
otherwise the default org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
is returned for JDK 1.3 and smaller.
For JDK 1.5 the default delivered parser is used:
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
and xmlBlaster/lib/parser.jar and jaxp.jar are obsolete.
For JDK 1.5 or higher any DOM Level 3 compliant parser should be OK.
XmlBlasterException
public I_EntryFactory getEntryFactory()
name
- A name identifying this plugin.public static java.lang.String encode(java.lang.String s, java.lang.String enc)
enc
- If null it defaults to "UTF-8"public static java.lang.String decode(java.lang.String s, java.lang.String enc)
enc
- If null it defaults to "UTF-8"public final ProtocolPluginManager getProtocolPluginManager()
public final CbServerPluginManager getCbServerPluginManager()
public final Timeout getBurstModeTimer()
public final I_TimeoutManager getPingTimer()
public final Timeout getMessageTimer()
public final Timeout getJdbcConnectionPoolTimer()
public final DispatchWorkerPool getDispatchWorkerPool()
public DispatchConnectionsHandler createClientDispatchConnectionsHandler(ClientDispatchManager dispatchManager) throws XmlBlasterException
XmlBlasterException
public void finalize()
finalize
in class java.lang.Object
public void shutdown()
public int getRunlevel()
public PluginManagerBase getPluginManager()
public PluginRegistry getPluginRegistry()
public I_XmlBlasterAccess getXmlBlasterAccess()
Access your client side handle with this method only, it is the with this Global instance configured client connection to xmlBlaster (a singleton regarding this Global).
Multiple invocations return the same instance.
NOTE: On server side engine.Global.getXmlBlasterAccess() returns the native access handle.
java.lang.IllegalArgumentException
- If we are extended by engine.Global (use getClone() to create a util.Global)public void setWipeOutDB(boolean doWipeout)
doWipeout
- public boolean getWipeOutDB()
public static java.lang.String getStackTraceAsString(java.lang.Throwable ex)
ex
- The exception for which to write out the stack trace. If you pass null it will print the Stack trace of
a newly created exception.
public java.lang.String[] getNativeConnectArgs()
If you write a native plugin you can use these settings as a base.
Don't use for plugins started on runlevel below AvailabilityChecker allows to publish as we don't have a client side queue.
public java.lang.String usage()
java -Dproperty.verbose 2 ... java org.xmlBlaster.Main -property.verbose 2
public static java.lang.String logUsage()
public static void main(java.lang.String[] args)
public java.lang.String get(java.lang.String shortKey, java.lang.String defaultValue, java.util.Properties map, I_PluginConfig pluginConfig) throws XmlBlasterException
shortKey
- the key (in its short form without prefix) of the propertydefaultValue
- the default value of the property (weakest)map
- the hardcoded properties (strongest)pluginConfig
- the pluginConfig used, checks the properties from PluginInfo
XmlBlasterException
public long get(java.lang.String shortKey, long defaultValue, java.util.Properties map, I_PluginConfig pluginConfig) throws XmlBlasterException
shortKey
- defaultValue
- map
- pluginConfig
-
XmlBlasterException
get(String, String, map, I_PluginConfig)
public int get(java.lang.String shortKey, int defaultValue, java.util.Properties map, I_PluginConfig pluginConfig) throws XmlBlasterException
shortKey
- defaultValue
- map
- pluginConfig
-
XmlBlasterException
get(String, String, map, I_PluginConfig)
public boolean get(java.lang.String shortKey, boolean defaultValue, java.util.Properties map, I_PluginConfig pluginConfig) throws XmlBlasterException
shortKey
- defaultValue
- map
- pluginConfig
-
XmlBlasterException
get(String, String, map, I_PluginConfig)
public double get(java.lang.String shortKey, double defaultValue, java.util.Properties map, I_PluginConfig pluginConfig) throws XmlBlasterException
shortKey
- defaultValue
- map
- pluginConfig
-
XmlBlasterException
get(String, String, map, I_PluginConfig)
public void resetInstanceId()
public java.lang.String getInstanceId()
public java.lang.String[] peekQueueMessagesToFile(I_Queue queue, int numOfEntries, java.lang.String path, java.lang.String label) throws XmlBlasterException
queue
- The queue to observenumOfEntries
- Maximum number of messages to dumppath
- The path to dump the messages to, it is automatically created if missing.label
- A nice queue name for logging/exceptions
XmlBlasterException
public static byte[] getFromClasspath(java.lang.String file, java.lang.Object location)
file
- The file to lookup
java.io.IOException
- if an I/O error occurs.
or IllegalArgumentException if not foundpublic static final java.lang.String byteString(long size)
System.out.println(Memory.DataLenStr(136000));
size
- is the size in bytes
public static java.lang.String getJavadocUrl(java.lang.String className, java.lang.String methodName)
className
- methodName
-
public static java.lang.String getJmxUsageLinkInfo(java.lang.String className, java.lang.String methodName)
className
- methodName
-
public java.util.Map getPersistentMap(java.lang.String id) throws XmlBlasterException
id
- The id identifying the map. Normally this would be the sessionId. If you pass null or an empty String, then a default map is returned.
XmlBlasterException
public static void gc(int numGc, long sleep)
public static final java.lang.String getMemoryStatistic()
public void putInWeakRegistry(java.lang.Object key, java.lang.Object value)
public java.lang.Object getFromWeakRegistry(java.lang.Object key)
public java.lang.Object removeFromWeakRegistry(java.lang.Object key)
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |