jpos.loader.simple
Class SimpleServiceConnection

java.lang.Object
  |
  +--jpos.loader.simple.SimpleServiceConnection
All Implemented Interfaces:
JposServiceConnection

public class SimpleServiceConnection
extends java.lang.Object
implements JposServiceConnection

This is a simple implementation of the JposServiceConnection interface

Since:
0.1 (Philly 99 meeting)
Author:
E. Michael Maximilien (maxim@us.ibm.com)

Constructor Summary
(package private) SimpleServiceConnection(java.lang.String logicalName, JposEntry entry, java.lang.String siFactoryClassName)
          Creates a new SimpleServiceConnection by passing the logicalName, the associated JposEntry and JposServiceInstanceFactory
 
Method Summary
 void connect()
          Connects this service by trying to create the JposServiceInstance
 void disconnect()
          Disconnect this connection
protected  void finalize()
          Add a finalizer method in case the service connection is garbage collected and the service of this connection has not been disconnected
 java.lang.String getLogicalName()
           
 JposServiceInstance getService()
           
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleServiceConnection

SimpleServiceConnection(java.lang.String logicalName,
                        JposEntry entry,
                        java.lang.String siFactoryClassName)
Creates a new SimpleServiceConnection by passing the logicalName, the associated JposEntry and JposServiceInstanceFactory
Parameters:
logicalName - the logicalName for this connection
entry - the JposEntry matching this logicalName
siFactoryClassName - the class name implememting the JposServiceInstanceFactory interface
Since:
0.1 (Philly 99 meeting)
Method Detail

getService

public JposServiceInstance getService()
Specified by:
getService in interface JposServiceConnection
Returns:
the JposServiceInstance for this connection (it's null util a succesful connection)
Since:
0.1 (Philly 99 meeting)

getLogicalName

public java.lang.String getLogicalName()
Specified by:
getLogicalName in interface JposServiceConnection
Returns:
the logicalName of the JposServiceInstance of this connection
Since:
0.1 (Philly 99 meeting)

connect

public void connect()
             throws jpos.JposException
Connects this service by trying to create the JposServiceInstance
Specified by:
connect in interface JposServiceConnection
Throws:
jpos.JposException - if the service throws a exception while disconnecting
Since:
0.1 (Philly 99 meeting)

disconnect

public void disconnect()
                throws jpos.JposException
Disconnect this connection
Specified by:
disconnect in interface JposServiceConnection
Throws:
jpos.JposException - if the service throws a exception while disconnecting
Since:
0.1 (Philly 99 meeting)

finalize

protected void finalize()
                 throws jpos.JposException
Add a finalizer method in case the service connection is garbage collected and the service of this connection has not been disconnected
Overrides:
finalize in class java.lang.Object
Throws:
jpos.JposException - if the service throws a exception while disconnecting
Since:
0.1 (Philly 99 meeting)


This API and code belongs to the JavaPOS committee please see LISCENCE file for details