xmlBlaster 2.2.0 API

Class SocketGetter

  extended by java.lang.Thread
      extended by org.xmlBlaster.contrib.socketgetter.SocketGetter
All Implemented Interfaces:

public class SocketGetter
extends java.lang.Thread

SocketGetter launches a xmlBlaster-client which listens on the given socket and delivers the content of the oid given in a telnet session.

java org.xmlBlaster.contrib.socketgetter.SocketGetter -port <port>

Example for usage:
java org.xmlBlaster.contrib.socketgetter.SocketGetter -port 9876 -plugin/socket/hostname server
(sleep 1; echo "get __sys__UserList"; sleep 1) | telnet localhost 9876
The host which the telnet connects to is the one which runns the SocketGetter. This host may differ from the one running the xmlBaslter server, of course.
In this example, the xmlBlaster runns on the host called server, where at the SocketGetter runns on the localhost on port 9876.

This class may be configured as a native plugin as well, see SocketGetterPlugin.

Heinrich Götzger

Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
Field Summary
private  Global glob
          The util.Global instance for this client.
private static java.util.logging.Logger log
          Holds the logger for this class.
private  int port
          The port where the socket listens on.
private  java.net.ServerSocket socketServer
          Holds the socket server.
private  I_XmlBlasterAccess xmlBlasterConnection
          Holds the connection to the xmlBlaster server.
Fields inherited from class java.lang.Thread
Constructor Summary
SocketGetter(Global global)
          Convenience constructor dor the use from the main method.
SocketGetter(Global global, int port)
          Starts the SocketGetter.
Method Summary
static void main(java.lang.String[] args)
          The main method.
 void run()
          Starts the socket getter task.
 void shutdown()
          Closes the connectionto xmlBlaster server.
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

Field Detail


private static java.util.logging.Logger log
Holds the logger for this class.


private I_XmlBlasterAccess xmlBlasterConnection
Holds the connection to the xmlBlaster server.


private Global glob
The util.Global instance for this client.


private int port
The port where the socket listens on.


private java.net.ServerSocket socketServer
Holds the socket server.

Constructor Detail


public SocketGetter(Global global,
                    int port)
Starts the SocketGetter. The args must contain a valid port.
This instance opens one connection to the xmlBlaster-server and starts a socket server on the given port. Once a client has been accepted by the server, a new thread will be startet for this client. A new client may connect to the listening socket immediately afterwards.
The socket-thread answers one get request and closes the connection right after the request has been answered.
The request must start with get otherwise no message will be delivered.

java.util.logging.Level.FINER is good for debugging purposes.

global - The Global instance created in main.
port - The port where the socket listens on.


public SocketGetter(Global global)
Convenience constructor dor the use from the main method.

global - The Global instance created in main.
Method Detail


public void run()
Starts the socket getter task.

Specified by:
run in interface java.lang.Runnable
run in class java.lang.Thread


public void shutdown()
Closes the connectionto xmlBlaster server.


public static void main(java.lang.String[] args)
The main method.

args - The command-line arguments.

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.