StreamSource streamSource = new ServerSocketStreamSource( serverSocket, server ); MLLPTransport transport = new MLLPTransport( streamSource ); transport.connect();
@Override public void jobFinished( Job job ) throws KettleException { KettleException exception = null; try { entry.getTransport().disconnect(); } catch ( Exception e ) { exception = new KettleException( e ); } try { entry.getStreamSource().disconnect(); } catch ( Exception e ) { exception = new KettleException( e ); } try { entry.getServerSocket().close(); } catch ( Exception e ) { exception = new KettleException( e ); } map.remove( key ); if ( exception != null ) { throw exception; } } } );
/** * Registers the given application to handle messages corresponding to the * given type and trigger event. Only one application can be registered for * a given message type and trigger event combination. A repeated * registration for a particular combination of type and trigger event * over-writes the previous one. Note that the wildcard "*" for messageType * or triggerEvent means any type or event, respectively. */ public void registerApplication(String messageType, String triggerEvent, ReceivingApplication handler) { applicationRouter.bindApplication(new AppRoutingDataImpl(messageType, triggerEvent, "*", "*"), handler); }
private static TransportLayer getTransport(ServerSocket theServerSocket, String theAddress) throws TransportException { ServerSocketStreamSource ss = new ServerSocketStreamSource(theServerSocket, theAddress); return new MLLPTransport(ss); }
/** * Accepts new connections on underlying ServerSocket, replacing * any existing socket with the new one, blocking until a connection * is available. See {@link DualTransportConnector} for a method of * connecting two <code>TransportLayer</code>s in a way that avoids deadlock. * * @see ca.uhn.hl7v2.protocol.StreamSource#connect() */ public void connect() throws TransportException { Acceptor a = new Acceptor(myServerSocket, myExpectedAddress); mySocket = a.waitForSocket(); }
Transportable transportable = new TransportableImpl( ackMessage ); transport.doSend( transportable );
var app = { init : function() { document.addEventListener("deviceready", this.deviceready, false); }, deviceready : function() { app.appWrapper = this.createAppWrapper();//watch out who is "this", you should use "app" but not "this" }, createAppWrapper : function() { return new AppWrapper(); } }; app.init();
/** * Calls cycle() if we do not expect another thread to be doing so * @param expectingAck as in cycle */ private void cycleIfNeeded(boolean expectingAck) throws HL7Exception { if (!myThreaded) { cycle(expectingAck); } }
/** * Returns an instance of AppRoutingData which accepts all * message types, versions, etc. */ public static AppRoutingData withAll() { return new AppRoutingDataImpl("*","*", "*", "*"); }
/** * @see ca.uhn.hl7v2.protocol.ApplicationRouter#enableBinding(ca.uhn.hl7v2.protocol.ApplicationRouter.AppRoutingData) */ public void enableBinding(AppRoutingData theRoutingData) { Binding b = findBinding(theRoutingData); if (b != null) { b.active = true; } }
/** * @see ca.uhn.hl7v2.protocol.ApplicationRouter#hasActiveBinding(ca.uhn.hl7v2.protocol.ApplicationRouter.AppRoutingData) */ public boolean hasActiveBinding(AppRoutingData theRoutingData) { boolean result = false; ReceivingApplication<? extends Message> app = findDestination(null, theRoutingData); if (app != null) { result = true; } return result; }
/** * Gets fresh instances of sockets. */ public void connect() throws TransportException { mySocket = getSocket(myAddress); }
/** * @see ca.uhn.hl7v2.protocol.TransportLayer#disconnect() */ public void disconnect() throws TransportException { myIsConnected = false; doDisconnect(); }
Transportable transportable = transport.doReceive(); String message = transportable.getMessage();
private static TransportLayer getTransport(ServerSocket theServerSocket, String theAddress) throws TransportException { ServerSocketStreamSource ss = new ServerSocketStreamSource(theServerSocket, theAddress); return new MLLPTransport(ss); }
/** * Registers the given application to handle messages corresponding to the * given type and trigger event. Only one application can be registered for * a given message type and trigger event combination. A repeated * registration for a particular combination of type and trigger event * over-writes the previous one. Note that the wildcard "*" for messageType * or triggerEvent means any type or event, respectively. */ public void registerApplication(String messageType, String triggerEvent, ReceivingApplication handler) { applicationRouter.bindApplication(new AppRoutingDataImpl(messageType, triggerEvent, "*", "*"), handler); }
/** * Accepts new connections on underlying ServerSocket, replacing * any existing socket with the new one, blocking until a connection * is available. See {@link DualTransportConnector} for a method of * connecting two <code>TransportLayer</code>s in a way that avoids deadlock. * * @see ca.uhn.hl7v2.protocol.StreamSource#connect() */ public void connect() throws TransportException { Acceptor a = new Acceptor(myServerSocket, myExpectedAddress); mySocket = a.waitForSocket(); }
/** * Calls cycle() if we do not expect another thread to be doing so * @param expectingAck as in cycle */ private void cycleIfNeeded(boolean expectingAck) throws HL7Exception { if (!myThreaded) { cycle(expectingAck); } }
/** * Returns an instance of AppRoutingData which accepts all * message types, versions, etc. */ public static AppRoutingData withAll() { return new AppRoutingDataImpl("*","*", "*", "*"); }
/** * @see ca.uhn.hl7v2.protocol.ApplicationRouter#enableBinding(ca.uhn.hl7v2.protocol.ApplicationRouter.AppRoutingData) */ public void enableBinding(AppRoutingData theRoutingData) { Binding b = findBinding(theRoutingData); if (b != null) { b.active = true; } }