javax.rad.remote
Class AbstractConnection

java.lang.Object
  extended by javax.rad.remote.AbstractConnection
All Implemented Interfaces:
ICloseable
Direct Known Subclasses:
MasterConnection, SubConnection

public abstract class AbstractConnection
extends java.lang.Object
implements ICloseable

The AbstractConnection encapsulates the access to an IConnection implementation.
It implements the connection listener handling and an implementation of ConnectionInfo.

See Also:
IConnection

Nested Class Summary
static class AbstractConnection.CallBackResultDelegate
          The CallBackResultDelegate is an ICallBackResultListener that forwards callback result events to single listeners.
static class AbstractConnection.ListenerDelegate<K>
          The ListenerDelegate is the base class for listener delegates.
static class AbstractConnection.PropertyChangedDelegate
          The PropertyChangedDelegate is an IConnectionPropertyChangedListener that forwards property changed events to single property listeners.
 
Field Summary
protected  ConnectionInfo coninf
          the connection information.
protected  IConnection connection
          the connection implementation.
 
Constructor Summary
protected AbstractConnection(IConnection pConnection)
          Creates a new instance of AppliationConnection with an IConnection implementation.
 
Method Summary
 void addCallBackResultListener(ICallBackResultListener pListener)
          Adds an ICallBackResultListener to the list of registered listeners.
 void addCallBackResultListener(java.lang.String pInstruction, ICallBackResultListener pListener)
          Adds an ICallBackResultListener to the list of registered listeners, for the given instruction.
 void addConnectionListener(IConnectionListener pListener)
          Adds an IConnectionListener to the list of registered listeners.
 void addPropertyChangedListener(IConnectionPropertyChangedListener pListener)
          Adds an IConnectionPropertyChangedListener to the list of registered listeners.
 void addPropertyChangedListener(java.lang.String pPropertyName, IConnectionPropertyChangedListener pListener)
          Adds an IConnectionPropertyChangedListener to the list of registered listeners, for the given property.
 void call(ICallBackListener[] pCallBack, java.lang.String[] pObjectName, java.lang.String[] pMethod, java.lang.Object[][] pParams)
          Calls desired methods of server objects, through the connection.
 void call(ICallBackListener pCallBack, java.lang.String pObjectName, java.lang.String pMethod)
          The method will call a remote method from a remote object.
 void call(ICallBackListener pCallBack, java.lang.String pObjectName, java.lang.String pMethod, java.lang.Object... pParams)
          The method will call a remote method from a remote object.
 java.lang.Object[] call(java.lang.String[] pObjectName, java.lang.String[] pMethod)
          Calls desired methods of server objects, through the connection.
 java.lang.Object[] call(java.lang.String[] pObjectName, java.lang.String[] pMethod, java.lang.Object[][] pParams)
          Calls desired methods of server objects, through the connection.
 java.lang.Object call(java.lang.String pObjectName, java.lang.String pMethod)
          The method will call a remote method from a remote object.
 java.lang.Object call(java.lang.String pObjectName, java.lang.String pMethod, java.lang.Object... pParams)
          The method will call a remote method from a remote object.
 void callAction(ICallBackListener[] pCallBack, java.lang.String[] pAction, java.lang.Object[][] pParams)
          The method will call one or more remote actions.
 void callAction(ICallBackListener pCallBack, java.lang.String pAction)
          The method will call a remote action.
 void callAction(ICallBackListener pCallBack, java.lang.String pAction, java.lang.Object... pParams)
          The method will call a remote action.
 java.lang.Object callAction(java.lang.String pAction)
          The method will call a remote action.
 java.lang.Object[] callAction(java.lang.String[] pAction)
          The method will call one or more remote actions.
 java.lang.Object[] callAction(java.lang.String[] pAction, java.lang.Object[][] pParams)
          The method will call one or more remote actions.
 java.lang.Object callAction(java.lang.String pAction, java.lang.Object... pParams)
          The method will call a remote action.
 void callBack(java.lang.Object[] pCallBackObject, java.lang.String[] pCallBackMethod, java.lang.String[] pObjectName, java.lang.String[] pMethod, java.lang.Object[][] pParams)
          Calls desired methods of server objects, through the connection.
 void callBack(java.lang.Object pCallBackObject, java.lang.String pCallBackMethod, java.lang.String pObjectName, java.lang.String pMethod)
          The method will call a remote method from a remote object.
 void callBack(java.lang.Object pCallBackObject, java.lang.String pCallBackMethod, java.lang.String pObjectName, java.lang.String pMethod, java.lang.Object... pParams)
          The method will call a remote method from a remote object.
 void callBackAction(java.lang.Object[] pCallBackObject, java.lang.String[] pCallBackMethod, java.lang.String[] pAction, java.lang.Object[][] pParams)
          The method will call one or more remote actions.
 void callBackAction(java.lang.Object pCallBackObject, java.lang.String pCallBackMethod, java.lang.String pAction)
          The method will call a remote action.
 void callBackAction(java.lang.Object pCallBackObject, java.lang.String pCallBackMethod, java.lang.String pAction, java.lang.Object... pParams)
          The method will call a remote action.
 void close()
          Close the connection.
protected  void close(boolean pDoCall)
          Close the connection, with or without remote call.
protected  ChangedHashtable<java.lang.String,java.lang.Object> createConnectionProperties()
          Gets the properties which will be sent to the server when opening a new connection.
protected  void finalize()
          
protected  void fireCall(boolean pCallBack, java.lang.String pObjectName, java.lang.String pMethodName, java.lang.Object... pParams)
          Fires the objectCalled methods to all registered connection listeners.
protected  void fireCallAction(boolean pCallBack, java.lang.String pAction, java.lang.Object... pParams)
          Fires the actionCalled methods to all registered connection listeners.
protected  void fireCallBackResult(CallBackResultEvent pEvent)
          Fires the callBackResult methods to all registered callback result listeners.
protected  void fireCallError(java.lang.Throwable pError)
          Fires the callError methods to all registered connection listeners.
protected  void fireClose()
          Fires the connectionClosed methods to all registered connection listeners.
protected  void fireOpen()
          Fires the connectionOpened methods to all registered connection listeners.
protected  void fireReOpen()
          Fires the connectionReOpened methods to all registered connection listeners.
 java.lang.String getApplicationName()
          Gets the application name which will be used from the remote server to authenticate the connection.
 IConnection getConnection()
          Returns the connection to the server.
 java.lang.Object getConnectionId()
          Gets the connection identifier for this connection.
 IConnectionListener[] getConnectionListener()
          Gets all registered IConnectionListeners.
 java.lang.String getLifeCycleName()
          Gets the name of the server-side life-cycle object.
 java.lang.String getPassword()
          Gets the password which will be used from the remote server to authenticate the connection.
 java.util.Hashtable<java.lang.String,java.lang.Object> getProperties()
          Gets a copy of the current properties.
 java.lang.Object getProperty(java.lang.String pName)
          Gets a connection property.
 int getTimeout()
          Gets the timeout of the connection.
protected abstract  UIInvoker getUIInvoker()
          Gets the UI invoker.
 java.lang.String getUserName()
          Gets the user name which will be used from the remote server to authenticate the connection.
protected  java.lang.Throwable handleCallError(java.lang.Throwable pError)
          Handles a call error.
 boolean isOpen()
          Checks if the connection is open.
protected  void logCommunication(long pStart, java.lang.String pTitle, java.lang.Throwable pError, java.lang.Object... pInfo)
          Loggs communication duration.
 void open()
          Opens the connection.
protected abstract  void openConnection()
          Opens the connection without event handling.
 void removeCallBackResultListener(ICallBackResultListener pListener)
          Removes the given ICallBackResultListener from the list of registered listeners.
 void removeCallBackResultListener(java.lang.String pInstruction)
          Removes all registered listeners for the given instruction.
 void removeCallBackResultListener(java.lang.String pInstruction, ICallBackResultListener pListener)
          Removes an ICallBackResultListener from the list of registered listeners, for the given instruction.
 void removeConnectionListener(IConnectionListener pListener)
          Removes an IConnectionListener from the list of registered listeners.
 void removePropertyChangedListener(IConnectionPropertyChangedListener pListener)
          Removes the given IConnectionPropertyChangedListener from the list of registered listeners.
 void removePropertyChangedListener(java.lang.String pPropertyName)
          Removes all registered listeners for the given property.
 void removePropertyChangedListener(java.lang.String pPropertyName, IConnectionPropertyChangedListener pListener)
          Removes an IConnectionPropertyChangedListener from the list of registered listeners, for the given property.
 void reopen()
          Reopens the connection.
 void setApplicationName(java.lang.String pApplicationName)
          Sets the application name which will be used from the remote server to authenticate the connection, when the connection is not open.
protected  java.lang.Throwable setConnection(java.lang.Throwable pError)
          Sets the connection property for all CommunicationException in the hierarchy of the given error.
 void setLifeCycleName(java.lang.String pName)
          Sets the name of the server-side life-cycle object.
 void setPassword(java.lang.String pPassword)
          Sets the password which will be used from the remote server to authenticate the connection, when the connection is not open.
 void setProperty(java.lang.String pName, java.lang.Object pValue)
          Sets a connection property.
 void setTimeout(int pMinutes)
          Sets the timeout of the connection.
 void setUserName(java.lang.String pUserName)
          Sets the user name which will be used from the remote server to authenticate the connection, when the connection is not open.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected IConnection connection
the connection implementation.


coninf

protected ConnectionInfo coninf
the connection information.

Constructor Detail

AbstractConnection

protected AbstractConnection(IConnection pConnection)
Creates a new instance of AppliationConnection with an IConnection implementation.

Parameters:
pConnection - the IConnection implementation
Method Detail

openConnection

protected abstract void openConnection()
                                throws java.lang.Throwable
Opens the connection without event handling.

Throws:
java.lang.Throwable - if the connection can not be or is already opened

getUIInvoker

protected abstract UIInvoker getUIInvoker()
Gets the UI invoker.

Returns:
the UI invoker
See Also:
UIInvoker

finalize

protected void finalize()
                 throws java.lang.Throwable

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setLifeCycleName

public void setLifeCycleName(java.lang.String pName)
Sets the name of the server-side life-cycle object.

Parameters:
pName - the name of the life-cycle object

getLifeCycleName

public java.lang.String getLifeCycleName()
Gets the name of the server-side life-cycle object.

Returns:
the name of the life-cycle object

setApplicationName

public void setApplicationName(java.lang.String pApplicationName)
Sets the application name which will be used from the remote server to authenticate the connection, when the connection is not open.

Parameters:
pApplicationName - the application name

getApplicationName

public java.lang.String getApplicationName()
Gets the application name which will be used from the remote server to authenticate the connection.

Returns:
the application name

setUserName

public void setUserName(java.lang.String pUserName)
Sets the user name which will be used from the remote server to authenticate the connection, when the connection is not open.

Parameters:
pUserName - the user name

getUserName

public java.lang.String getUserName()
Gets the user name which will be used from the remote server to authenticate the connection.

Returns:
the user name

setPassword

public void setPassword(java.lang.String pPassword)
Sets the password which will be used from the remote server to authenticate the connection, when the connection is not open.

Parameters:
pPassword - the password

getPassword

public java.lang.String getPassword()
Gets the password which will be used from the remote server to authenticate the connection.

Returns:
the password

open

public void open()
          throws java.lang.Throwable
Opens the connection.

Throws:
java.lang.Throwable - if the connection can not be or is already opened

isOpen

public boolean isOpen()
Checks if the connection is open.

Returns:
true if the connection is open, otherwise false

close

public void close()
           throws java.lang.Throwable
Close the connection.

Specified by:
close in interface ICloseable
Throws:
java.lang.Throwable - if it is not possible to close the connection

close

protected void close(boolean pDoCall)
              throws java.lang.Throwable
Close the connection, with or without remote call.

Parameters:
pDoCall - true to send close to the server, false to close internal without remote communication (client-side close)
Throws:
java.lang.Throwable - if it is not possible to close the connection

reopen

public void reopen()
            throws java.lang.Throwable
Reopens the connection.

Throws:
java.lang.Throwable - if an error occurs while opening the connection

getConnection

public IConnection getConnection()
Returns the connection to the server.

Returns:
the connection

getConnectionId

public java.lang.Object getConnectionId()
Gets the connection identifier for this connection.

Returns:
the connection identifier

callBack

public void callBack(java.lang.Object[] pCallBackObject,
                     java.lang.String[] pCallBackMethod,
                     java.lang.String[] pObjectName,
                     java.lang.String[] pMethod,
                     java.lang.Object[][] pParams)
              throws java.lang.Throwable
Calls desired methods of server objects, through the connection.

Parameters:
pCallBackObject - the callback listener objects
pCallBackMethod - the callback listener methods
pObjectName - list of already mapped server object names/aliases
pMethod - method names which should be called
pParams - parameters for the method calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

call

public void call(ICallBackListener[] pCallBack,
                 java.lang.String[] pObjectName,
                 java.lang.String[] pMethod,
                 java.lang.Object[][] pParams)
          throws java.lang.Throwable
Calls desired methods of server objects, through the connection.

Parameters:
pCallBack - callback listeners for asynchronous or null for synchronous calls
pObjectName - list of already mapped server object names/aliases
pMethod - method names which should be called
pParams - parameters for the method calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callBack

public void callBack(java.lang.Object pCallBackObject,
                     java.lang.String pCallBackMethod,
                     java.lang.String pObjectName,
                     java.lang.String pMethod,
                     java.lang.Object... pParams)
              throws java.lang.Throwable
The method will call a remote method from a remote object.

Parameters:
pCallBackObject - the callback listener object
pCallBackMethod - the callback listener method
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
pParams - parameters for the method call
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

call

public void call(ICallBackListener pCallBack,
                 java.lang.String pObjectName,
                 java.lang.String pMethod,
                 java.lang.Object... pParams)
          throws java.lang.Throwable
The method will call a remote method from a remote object.

Parameters:
pCallBack - callback listener for asynchronous or null for synchronous call
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
pParams - parameters for the method call
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

callBack

public void callBack(java.lang.Object pCallBackObject,
                     java.lang.String pCallBackMethod,
                     java.lang.String pObjectName,
                     java.lang.String pMethod)
              throws java.lang.Throwable
The method will call a remote method from a remote object.

Parameters:
pCallBackObject - the callback listener object
pCallBackMethod - the callback listener method
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

call

public void call(ICallBackListener pCallBack,
                 java.lang.String pObjectName,
                 java.lang.String pMethod)
          throws java.lang.Throwable
The method will call a remote method from a remote object.

Parameters:
pCallBack - callback listener for asynchronous or null for synchronous call
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

call

public java.lang.Object[] call(java.lang.String[] pObjectName,
                               java.lang.String[] pMethod,
                               java.lang.Object[][] pParams)
                        throws java.lang.Throwable
Calls desired methods of server objects, through the connection. This call will be synchronous.

Parameters:
pObjectName - list of already mapped server object names/aliases
pMethod - method names which should be called
pParams - parameters for the method calls
Returns:
result list from the remote method calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

call

public java.lang.Object[] call(java.lang.String[] pObjectName,
                               java.lang.String[] pMethod)
                        throws java.lang.Throwable
Calls desired methods of server objects, through the connection. This call will be synchronous.

Parameters:
pObjectName - list of already mapped server object names/aliases
pMethod - method names which should be called
Returns:
result list from the remote method calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

call

public java.lang.Object call(java.lang.String pObjectName,
                             java.lang.String pMethod,
                             java.lang.Object... pParams)
                      throws java.lang.Throwable
The method will call a remote method from a remote object. The call will be synchronous.

Parameters:
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
pParams - parameters for the method call
Returns:
result from the remote method call
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

call

public java.lang.Object call(java.lang.String pObjectName,
                             java.lang.String pMethod)
                      throws java.lang.Throwable
The method will call a remote method from a remote object. The call will be synchronous.

Parameters:
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
Returns:
result from the remote method call
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callAction

public java.lang.Object callAction(java.lang.String pAction)
                            throws java.lang.Throwable
The method will call a remote action. The call will be synchronous.

Parameters:
pAction - action which should be called
Returns:
result from the remote action call
Throws:
java.lang.Throwable - communication error, security checks, invalid action, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callAction

public java.lang.Object callAction(java.lang.String pAction,
                                   java.lang.Object... pParams)
                            throws java.lang.Throwable
The method will call a remote action. The call will be synchronous.

Parameters:
pAction - action which should be called
pParams - parameters for the action call
Returns:
result from the remote action call
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callAction

public java.lang.Object[] callAction(java.lang.String[] pAction,
                                     java.lang.Object[][] pParams)
                              throws java.lang.Throwable
The method will call one or more remote actions. The call will be synchronous.

Parameters:
pAction - list of actions which should be called
pParams - parameters for the action calls
Returns:
result list from the remote action calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callAction

public java.lang.Object[] callAction(java.lang.String[] pAction)
                              throws java.lang.Throwable
The method will call one or more remote actions. The call will be synchronous.

Parameters:
pAction - list of actions which should be called
Returns:
result list from the remote action calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callBackAction

public void callBackAction(java.lang.Object pCallBackObject,
                           java.lang.String pCallBackMethod,
                           java.lang.String pAction)
                    throws java.lang.Throwable
The method will call a remote action.

Parameters:
pCallBackObject - the callback listener object
pCallBackMethod - the callback listener method
pAction - action which should be called
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callAction

public void callAction(ICallBackListener pCallBack,
                       java.lang.String pAction)
                throws java.lang.Throwable
The method will call a remote action.

Parameters:
pCallBack - callback listener for asynchronous or null for synchronous call
pAction - action which should be called
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callBackAction

public void callBackAction(java.lang.Object pCallBackObject,
                           java.lang.String pCallBackMethod,
                           java.lang.String pAction,
                           java.lang.Object... pParams)
                    throws java.lang.Throwable
The method will call a remote action.

Parameters:
pCallBackObject - the callback listener object
pCallBackMethod - the callback listener method
pAction - action which should be called
pParams - parameters for the action call
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callAction

public void callAction(ICallBackListener pCallBack,
                       java.lang.String pAction,
                       java.lang.Object... pParams)
                throws java.lang.Throwable
The method will call a remote action.

Parameters:
pCallBack - callback listener for asynchronous or null for synchronous call
pAction - action which should be called
pParams - parameters for the action call
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callBackAction

public void callBackAction(java.lang.Object[] pCallBackObject,
                           java.lang.String[] pCallBackMethod,
                           java.lang.String[] pAction,
                           java.lang.Object[][] pParams)
                    throws java.lang.Throwable
The method will call one or more remote actions.

Parameters:
pCallBackObject - the callback listener objects
pCallBackMethod - the callback listener methods
pAction - list of actions which should be called
pParams - parameters for the action calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

callAction

public void callAction(ICallBackListener[] pCallBack,
                       java.lang.String[] pAction,
                       java.lang.Object[][] pParams)
                throws java.lang.Throwable
The method will call one or more remote actions.

Parameters:
pCallBack - callback listeners for asynchronous or null for synchronous calls
pAction - list of actions which should be called
pParams - parameters for the action calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
See Also:
IConnection.call(ConnectionInfo, String[], String[], Object[][], ICallBackListener[])

setProperty

public void setProperty(java.lang.String pName,
                        java.lang.Object pValue)
                 throws java.lang.Throwable
Sets a connection property. It's not allowed to set/change client properties.

Parameters:
pName - the property name
pValue - the value of the property or null to delete the property
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

getProperty

public java.lang.Object getProperty(java.lang.String pName)
                             throws java.lang.Throwable
Gets a connection property.

Parameters:
pName - the property name
Returns:
the value of the property or null if the property is not available
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

getProperties

public java.util.Hashtable<java.lang.String,java.lang.Object> getProperties()
                                                                     throws java.lang.Throwable
Gets a copy of the current properties.

Returns:
the known properties and its values
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

setTimeout

public void setTimeout(int pMinutes)
                throws java.lang.Throwable
Sets the timeout of the connection.

Parameters:
pMinutes - the timeout in minutes or -1 to disable timeout
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

getTimeout

public int getTimeout()
               throws java.lang.Throwable
Gets the timeout of the connection.

Returns:
the timeout in minutes (-2 if timeout is unknown or not explicitely set)
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

createConnectionProperties

protected ChangedHashtable<java.lang.String,java.lang.Object> createConnectionProperties()
Gets the properties which will be sent to the server when opening a new connection.

Returns:
the properties as list with key/value pairs

addConnectionListener

public void addConnectionListener(IConnectionListener pListener)
Adds an IConnectionListener to the list of registered listeners.

Parameters:
pListener - the new connection listener

removeConnectionListener

public void removeConnectionListener(IConnectionListener pListener)
Removes an IConnectionListener from the list of registered listeners.

Parameters:
pListener - the new connection listener

getConnectionListener

public IConnectionListener[] getConnectionListener()
Gets all registered IConnectionListeners.

Returns:
an array with IConnectionListeners or null if no listener is registered

addPropertyChangedListener

public void addPropertyChangedListener(IConnectionPropertyChangedListener pListener)
Adds an IConnectionPropertyChangedListener to the list of registered listeners.

Parameters:
pListener - the listener

addPropertyChangedListener

public void addPropertyChangedListener(java.lang.String pPropertyName,
                                       IConnectionPropertyChangedListener pListener)
Adds an IConnectionPropertyChangedListener to the list of registered listeners, for the given property.

Parameters:
pPropertyName - the property name
pListener - the listener

removePropertyChangedListener

public void removePropertyChangedListener(java.lang.String pPropertyName)
Removes all registered listeners for the given property.

Parameters:
pPropertyName - the property name

removePropertyChangedListener

public void removePropertyChangedListener(IConnectionPropertyChangedListener pListener)
Removes the given IConnectionPropertyChangedListener from the list of registered listeners.

Parameters:
pListener - the listener or null to remove all registered listeners

removePropertyChangedListener

public void removePropertyChangedListener(java.lang.String pPropertyName,
                                          IConnectionPropertyChangedListener pListener)
Removes an IConnectionPropertyChangedListener from the list of registered listeners, for the given property.

Parameters:
pPropertyName - the property name
pListener - the listener or null to remove all registered listeners

addCallBackResultListener

public void addCallBackResultListener(ICallBackResultListener pListener)
Adds an ICallBackResultListener to the list of registered listeners.

Parameters:
pListener - the listener

addCallBackResultListener

public void addCallBackResultListener(java.lang.String pInstruction,
                                      ICallBackResultListener pListener)
Adds an ICallBackResultListener to the list of registered listeners, for the given instruction.

Parameters:
pInstruction - the instruction identifier
pListener - the listener

removeCallBackResultListener

public void removeCallBackResultListener(ICallBackResultListener pListener)
Removes the given ICallBackResultListener from the list of registered listeners.

Parameters:
pListener - the listener or null to remove all registered listeners

removeCallBackResultListener

public void removeCallBackResultListener(java.lang.String pInstruction)
Removes all registered listeners for the given instruction.

Parameters:
pInstruction - the instruction identifier

removeCallBackResultListener

public void removeCallBackResultListener(java.lang.String pInstruction,
                                         ICallBackResultListener pListener)
Removes an ICallBackResultListener from the list of registered listeners, for the given instruction.

Parameters:
pInstruction - the instruction identifier
pListener - the listener or null to remove all registered listeners

fireCallError

protected void fireCallError(java.lang.Throwable pError)
Fires the callError methods to all registered connection listeners.

Parameters:
pError - the occured error

fireCallBackResult

protected void fireCallBackResult(CallBackResultEvent pEvent)
                           throws java.lang.Throwable
Fires the callBackResult methods to all registered callback result listeners.

Parameters:
pEvent - the event
Throws:
java.lang.Throwable - if notification fails

handleCallError

protected java.lang.Throwable handleCallError(java.lang.Throwable pError)
Handles a call error. This methods sets the connection for every CommunicationException and notifies connection listeners via fireCallError(Throwable).

Parameters:
pError - the occured error
Returns:
the changed pError
See Also:
setConnection(Throwable), fireCallError(Throwable)

setConnection

protected java.lang.Throwable setConnection(java.lang.Throwable pError)
Sets the connection property for all CommunicationException in the hierarchy of the given error.

Parameters:
pError - the occured error
Returns:
the changed pError

fireOpen

protected void fireOpen()
Fires the connectionOpened methods to all registered connection listeners.


fireReOpen

protected void fireReOpen()
Fires the connectionReOpened methods to all registered connection listeners.


fireClose

protected void fireClose()
Fires the connectionClosed methods to all registered connection listeners.


fireCall

protected void fireCall(boolean pCallBack,
                        java.lang.String pObjectName,
                        java.lang.String pMethodName,
                        java.lang.Object... pParams)
Fires the objectCalled methods to all registered connection listeners.

Parameters:
pCallBack - whether the call was a callback call
pObjectName - the name of the remote object
pMethodName - the name of the method
pParams - the method parameters

fireCallAction

protected void fireCallAction(boolean pCallBack,
                              java.lang.String pAction,
                              java.lang.Object... pParams)
Fires the actionCalled methods to all registered connection listeners.

Parameters:
pCallBack - whether the action call was a callback call
pAction - the name of the action
pParams - the method parameters

logCommunication

protected void logCommunication(long pStart,
                                java.lang.String pTitle,
                                java.lang.Throwable pError,
                                java.lang.Object... pInfo)
Loggs communication duration.

Parameters:
pStart - the communication start
pTitle - the communication "title", means the triggering method name like "open"
pError - if an error occured
pInfo - the log information (parameter)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.