jPOS 1.6.7 API Documentation

org.jpos.q2.iso
Class OneShotChannelAdaptor

java.lang.Object
  extended by org.jpos.q2.QBeanSupport
      extended by org.jpos.q2.iso.OneShotChannelAdaptor
All Implemented Interfaces:
Configurable, Channel, OneShotChannelAdaptorMBean, QBean, QBeanSupportMBean, QPersist

public class OneShotChannelAdaptor
extends QBeanSupport
implements OneShotChannelAdaptorMBean, Channel

OneShotChannelAdaptor connects and disconnects a channel for every message exchange.

Example qbean:

<client class="org.jpos.q2.iso.OneShotChannelAdaptor" logger="Q2" name="channel-adaptor">
<channel ...
...
...
</channel>
<max-connections>5</max-connections>
<max-connect-attempts>15</max-connect-attempts>
<in>send</in>
<out>receive</out>
</client>

Version:
$Revision: 2854 $ $Date: 2010-01-02 02:34:31 -0800 (Sat, 02 Jan 2010) $
Author:
Alejandro Revilla, Thomas L. Kjeldsen

Nested Class Summary
 class OneShotChannelAdaptor.Worker
           
 
Field Summary
 
Fields inherited from interface org.jpos.q2.QBean
DESTROYED, FAILED, STARTED, STARTING, stateString, STOPPED, STOPPING
 
Constructor Summary
OneShotChannelAdaptor()
           
 
Method Summary
 void destroyService()
           
 java.lang.String getHost()
           
 java.lang.String getInQueue()
           
 java.lang.String getOutQueue()
           
 int getPort()
           
 java.lang.String getSocketFactory()
           
 void initAdaptor()
           
 ISOMsg receive()
          Receive message
 ISOMsg receive(long timeout)
          Receive message
 void send(ISOMsg m)
          Queue a message to be transmitted by this adaptor
 void send(ISOMsg m, long timeout)
          Queue a message to be transmitted by this adaptor
 void setHost(java.lang.String host)
           
 void setInQueue(java.lang.String in)
           
 void setOutQueue(java.lang.String out)
           
 void setPort(int port)
           
 void setSocketFactory(java.lang.String sFac)
           
 void startService()
           
 void stopService()
           
 
Methods inherited from class org.jpos.q2.QBeanSupport
destroy, getConfiguration, getFactory, getLoader, getLoaderURLS, getLog, getLogger, getName, getPersist, getRealm, getServer, getState, getStateAsString, init, isModified, running, setConfiguration, setLogger, setModified, setName, setPersist, setRealm, setServer, setState, shutdownQ2, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jpos.q2.QBeanSupportMBean
getLoader, getLoaderURLS, getLogger, getName, getRealm, getServer, setLogger, setName, setPersist, setRealm, setServer, shutdownQ2
 
Methods inherited from interface org.jpos.q2.QBean
destroy, getState, getStateAsString, init, start, stop
 
Methods inherited from interface org.jpos.q2.QPersist
getPersist, isModified
 

Constructor Detail

OneShotChannelAdaptor

public OneShotChannelAdaptor()
Method Detail

initAdaptor

public void initAdaptor()

startService

public void startService()

stopService

public void stopService()

destroyService

public void destroyService()

send

public void send(ISOMsg m)
Queue a message to be transmitted by this adaptor

Specified by:
send in interface Channel
Parameters:
m - message to send

send

public void send(ISOMsg m,
                 long timeout)
Queue a message to be transmitted by this adaptor

Parameters:
m - message to send
timeout - in millis

receive

public ISOMsg receive()
Receive message

Specified by:
receive in interface Channel
Returns:
received message

receive

public ISOMsg receive(long timeout)
Receive message

Specified by:
receive in interface Channel
Parameters:
timeout - time to wait for an incoming message
Returns:
received message or null

setInQueue

public void setInQueue(java.lang.String in)
Specified by:
setInQueue in interface OneShotChannelAdaptorMBean

getInQueue

public java.lang.String getInQueue()
Specified by:
getInQueue in interface OneShotChannelAdaptorMBean

setOutQueue

public void setOutQueue(java.lang.String out)
Specified by:
setOutQueue in interface OneShotChannelAdaptorMBean

getOutQueue

public java.lang.String getOutQueue()
Specified by:
getOutQueue in interface OneShotChannelAdaptorMBean

setHost

public void setHost(java.lang.String host)
Specified by:
setHost in interface OneShotChannelAdaptorMBean

getHost

public java.lang.String getHost()
Specified by:
getHost in interface OneShotChannelAdaptorMBean

setPort

public void setPort(int port)
Specified by:
setPort in interface OneShotChannelAdaptorMBean

getPort

public int getPort()
Specified by:
getPort in interface OneShotChannelAdaptorMBean

setSocketFactory

public void setSocketFactory(java.lang.String sFac)
Specified by:
setSocketFactory in interface OneShotChannelAdaptorMBean

getSocketFactory

public java.lang.String getSocketFactory()
Specified by:
getSocketFactory in interface OneShotChannelAdaptorMBean

jPOS.org