|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.xmlBlaster.protocol.socket.SocketDriver
public class SocketDriver
Socket driver class to invoke the xmlBlaster server over a native message format
This "SOCKET:" driver needs to be registered in xmlBlaster.properties and will be started on xmlBlaster startup, for example:ProtocolPlugin[SOCKET][1.0]=org.xmlBlaster.protocol.socket.SocketDriver CbProtocolPlugin[SOCKET][1.0]=org.xmlBlaster.protocol.socket.CallbackSocketDriverThe variable plugin/socket/port (default 7607) sets the socket server port, you may change it in xmlBlaster.properties or on command line:
java -jar lib/xmlBlaster.jar -plugin/socket/port 9090The interface I_Driver is needed by xmlBlaster to instantiate and shutdown this driver implementation. All adjustable parameters are explained in
usage()
MsgInfo
,
The protocol.socket requirementNested Class Summary | |
---|---|
(package private) class |
SocketDriver.UDPListener
There is exactly one UDP listener thread which receives datagrams for all clients. |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private AddressServer |
addressServer
The address configuration |
private I_Authenticate |
authenticate
The singleton handle for this authentication server |
protected ContextNode |
contextNode
|
private Global |
glob
The global handle |
private java.util.Map |
handleClientMap
|
private java.util.Set |
handleClientSet
Remember all client connections |
protected boolean |
isShutdown
|
private java.net.ServerSocket |
listen
The socket server |
private boolean |
listenerReady
|
private boolean |
listenerReadyUDP
|
private java.lang.Thread |
listenerUDP
State of server |
private static java.util.logging.Logger |
log
|
protected java.lang.Object |
mbeanHandle
My JMX registration |
private java.lang.String |
ME
|
private PluginInfo |
pluginInfo
|
private boolean |
running
|
private boolean |
runningUDP
|
private java.net.DatagramSocket |
socketUDP
The URL which clients need to use to access this server, e.g. |
private SocketUrl |
socketUrl
The socket address info object holding hostname (useful for multi homed hosts) and port |
private int |
sslMarker
|
private boolean |
startUdpListener
|
private boolean |
useUdpForOneway
Setting by plugin configuration, see xmlBlasterPlugins.xml, for example <attribute id='useUdpForOneway'>true</attribute> |
private I_XmlBlaster |
xmlBlasterImpl
The singleton handle for this xmlBlaster server |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
SocketDriver()
Creates the driver. |
Method Summary | |
---|---|
void |
activate()
Activate xmlBlaster access through this protocol. |
(package private) void |
addClient(java.lang.String sessionId,
HandleClient h)
|
void |
deActivate()
Deactivate xmlBlaster access (standby), no clients can connect. |
(package private) AddressServer |
getAddressServer()
|
(package private) I_Authenticate |
getAuthenticate()
Access the handle to the xmlBlaster authenication core |
(package private) HandleClient |
getClient(java.lang.String sessionId)
|
java.lang.String |
getEnvPrefix()
The command line key prefix |
(package private) Global |
getGlobal()
|
I_PluginConfig |
getPluginConfig()
|
java.lang.String |
getProtocolId()
Access the xmlBlaster internal name of the protocol driver. |
java.lang.String |
getRawAddress()
Get the address how to access this driver. |
java.lang.String |
getType()
Enforced by I_Plugin |
java.lang.String |
getUsageUrl()
|
java.lang.String |
getVersion()
Enforced by I_Plugin |
(package private) I_XmlBlaster |
getXmlBlaster()
Access the handle to the xmlBlaster core |
private void |
init(Global glob,
AddressServer addressServer,
I_Authenticate authenticate,
I_XmlBlaster xmlBlasterImpl)
Start xmlBlaster SOCKET access. |
void |
init(Global glob,
PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
boolean |
isActive()
Access the current state |
boolean |
isShutdown()
Check status |
boolean |
isSSL()
Is SSL support switched on? |
(package private) void |
removeClient(HandleClient h)
|
void |
run()
Starts the server socket and waits for clients to connect. |
void |
setUsageUrl(java.lang.String url)
|
void |
shutdown()
Close the listener port, the driver shuts down. |
boolean |
startUdpListener()
Switch on/off UDP socket listener |
java.lang.String |
usage()
Command line usage. |
boolean |
useUdpForOneway()
Configuration option to use UDP for updateOneway() calls. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.xmlBlaster.protocol.I_Driver |
---|
getName |
Field Detail |
---|
private java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private I_Authenticate authenticate
private I_XmlBlaster xmlBlasterImpl
private SocketUrl socketUrl
private java.net.ServerSocket listen
private java.net.DatagramSocket socketUDP
private java.lang.Thread listenerUDP
private int sslMarker
private boolean running
private boolean runningUDP
private boolean listenerReady
private boolean listenerReadyUDP
private java.util.Set handleClientSet
private java.util.Map handleClientMap
private AddressServer addressServer
private PluginInfo pluginInfo
private boolean startUdpListener
private boolean useUdpForOneway
protected java.lang.Object mbeanHandle
protected ContextNode contextNode
protected boolean isShutdown
Constructor Detail |
---|
public SocketDriver()
Method Detail |
---|
void addClient(java.lang.String sessionId, HandleClient h)
HandleClient getClient(java.lang.String sessionId)
public I_PluginConfig getPluginConfig()
public java.lang.String getProtocolId()
getProtocolId
in interface I_Driver
public java.lang.String getType()
getType
in interface I_AdminPlugin
getType
in interface I_Plugin
public java.lang.String getEnvPrefix()
public java.lang.String getVersion()
getVersion
in interface I_AdminPlugin
getVersion
in interface I_Plugin
public boolean startUdpListener()
public boolean useUdpForOneway()
public void init(Global glob, PluginInfo pluginInfo) throws XmlBlasterException
init
in interface I_Plugin
XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public java.lang.String getRawAddress()
getRawAddress
in interface I_Driver
getRawAddress
in interface SocketDriverMBean
I_Authenticate getAuthenticate()
I_XmlBlaster getXmlBlaster()
AddressServer getAddressServer()
private void init(Global glob, AddressServer addressServer, I_Authenticate authenticate, I_XmlBlaster xmlBlasterImpl) throws XmlBlasterException
glob
- Global handle to access logging, property and commandline argsauthenticate
- Handle to access authentication serverxmlBlasterImpl
- Handle to access xmlBlaster core
XmlBlasterException
public void activate() throws XmlBlasterException
activate
in interface I_Driver
activate
in interface I_AdminService
XmlBlasterException
public boolean isActive()
I_AdminService
isActive
in interface I_AdminService
public void deActivate() throws java.lang.RuntimeException
deActivate
in interface I_Driver
deActivate
in interface I_AdminService
java.lang.RuntimeException
final void removeClient(HandleClient h)
final Global getGlobal()
public final boolean isSSL()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void shutdown() throws XmlBlasterException
shutdown
in interface I_AdminPlugin
shutdown
in interface I_Plugin
XmlBlasterException
- if an exception occurs. The exception is
handled by the RunLevelManager depending on how the plugin has been
configured with the action:
<action do='STOP' onShutdownRunlevel='2' sequence='5'
onFail='resource.configuration.pluginFailed'>
If onFail is defined to something, the RunLevelManager will stop.public boolean isShutdown()
I_AdminPlugin
isShutdown
in interface I_AdminPlugin
public java.lang.String getUsageUrl()
getUsageUrl
in interface I_AdminUsage
public void setUsageUrl(java.lang.String url)
setUsageUrl
in interface I_AdminUsage
public java.lang.String usage()
usage
in interface I_Driver
usage
in interface I_AdminUsage
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |