|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.rad.remote.AbstractSerializedConnection
public abstract class AbstractSerializedConnection
This is the default IConnection
implementation. It's independent
of the communication protocol.
Field Summary | |
---|---|
static String |
PROP_SERIALIZER
the property name for the serializer. |
Constructor Summary | |
---|---|
AbstractSerializedConnection(ISerializer pSerializer)
Creates a new instance of AbstractSerializedConnection . |
|
AbstractSerializedConnection(Properties pProperties)
Creates a new instance of AbstractSerializedConnection with
properties containing relevant information. |
Method Summary | |
---|---|
Object[] |
call(ConnectionInfo pConnectionInfo,
String[] pObjectName,
String[] pMethod,
Object[][] pParams,
ICallBackListener[] pCallBack)
Calls desired methods from a remote server object. |
void |
close(ConnectionInfo pConnectionInfo)
Close the connection to the server. |
protected static ISerializer |
createSerializer(String pClassName)
Creates the serializer from a given class name. |
protected void |
finalize()
|
abstract InputStream |
getInputStream(ConnectionInfo pConnectionInfo)
Gets the InputStream for reading the response from the
server. |
abstract OutputStream |
getOutputStream(ConnectionInfo pConnectionInfo)
Gets the OutputStream for submitting requests to the
server. |
Hashtable<String,Object> |
getProperties(ConnectionInfo pConnectionInfo)
Gets a clone of all connection properties. |
Object |
getProperty(ConnectionInfo pConnectionInfo,
String pName)
Gets a connection property. |
boolean |
isCalling()
Gets whether a call is active. |
boolean |
isOpen(ConnectionInfo pConnectionInfo)
Checks if the connection to the server is opened. |
void |
open(ConnectionInfo pConnectionInfo)
Opens the connection to the server. |
void |
openSub(ConnectionInfo pConnectionInfo,
ConnectionInfo pConnectionInfoSub)
Opens a new sub connection. |
void |
reopen(ConnectionInfo pConnectionInfo)
Closes and opens the connection to the server. |
ConnectionInfo[] |
setAndCheckAlive(ConnectionInfo pConnectionInfo,
ConnectionInfo[] pSubConnections)
Sets the alive state for a connection, on the server, and validates the alive state of subconnections. |
void |
setNewPassword(ConnectionInfo pConnectionInfo,
String pOldPassword,
String pNewPassword)
Sets a new password for the connected user. |
void |
setProperty(ConnectionInfo pConnectionInfo,
String pName,
Object pValue)
Sets a connection property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_SERIALIZER
Constructor Detail |
---|
public AbstractSerializedConnection(Properties pProperties) throws ClassNotFoundException
AbstractSerializedConnection
with
properties containing relevant information. The supported property
keys are:
pProperties
- the properties for the connection
ClassNotFoundException
- if the serializer is defined and could not be createdpublic AbstractSerializedConnection(ISerializer pSerializer)
AbstractSerializedConnection
.
pSerializer
- the serializer for the communication between client and server or
null to use the default serializerISerializer
,
ByteSerializer
Method Detail |
---|
public void open(ConnectionInfo pConnectionInfo) throws Throwable
open
in interface IConnection
pConnectionInfo
- the connection information
Throwable
- if the connection can not be establishedpublic void openSub(ConnectionInfo pConnectionInfo, ConnectionInfo pConnectionInfoSub) throws Throwable
openSub
in interface IConnection
pConnectionInfo
- the connection information of the master connectionpConnectionInfoSub
- the connection information of the sub connection
Throwable
- communication error, security checks, invalid method, ...public boolean isOpen(ConnectionInfo pConnectionInfo)
isOpen
in interface IConnection
pConnectionInfo
- the connection information
public void close(ConnectionInfo pConnectionInfo) throws Throwable
close
in interface IConnection
pConnectionInfo
- the connection information
Throwable
- if the connection can not be establishedpublic void reopen(ConnectionInfo pConnectionInfo) throws Throwable
reopen
in interface IConnection
pConnectionInfo
- the connection information
Throwable
- if the connection can not be establishedpublic Object[] call(ConnectionInfo pConnectionInfo, String[] pObjectName, String[] pMethod, Object[][] pParams, ICallBackListener[] pCallBack) throws Throwable
call
in interface IConnection
pConnectionInfo
- the connection informationpObjectName
- list of server object names/aliasespMethod
- method names which should be calledpParams
- parameters for the method callspCallBack
- callback listeners for asynchronous or null for synchronous calls
Throwable
- communication error, security checks, invalid method, ...public ConnectionInfo[] setAndCheckAlive(ConnectionInfo pConnectionInfo, ConnectionInfo[] pSubConnections) throws Throwable
setAndCheckAlive
in interface IConnection
pConnectionInfo
- the connection informationpSubConnections
- the connection information of the sub connections, for the alive validation
Throwable
- communication error, security checks, invalid method, ...public void setProperty(ConnectionInfo pConnectionInfo, String pName, Object pValue) throws Throwable
setProperty
in interface IConnection
pConnectionInfo
- the connection informationpName
- the property namepValue
- the value of the property or null
to delete the property
Throwable
- communication error, security checks, invalid method, ...
SecurityException
- if it's not allowed to set the propertypublic Object getProperty(ConnectionInfo pConnectionInfo, String pName) throws Throwable
getProperty
in interface IConnection
pConnectionInfo
- the connection informationpName
- the property name
null
if the property is not set
Throwable
- communication error, security checks, invalid method, ...public Hashtable<String,Object> getProperties(ConnectionInfo pConnectionInfo) throws Throwable
getProperties
in interface IConnection
pConnectionInfo
- the connection information
Hashtable
with property names and values
Throwable
- communication error, security checks, invalid method, ...public void setNewPassword(ConnectionInfo pConnectionInfo, String pOldPassword, String pNewPassword) throws Throwable
setNewPassword
in interface IConnection
pConnectionInfo
- the connection informationpOldPassword
- the old passwordpNewPassword
- the new password
Throwable
- communication error, security checks, invalid method, ...public abstract OutputStream getOutputStream(ConnectionInfo pConnectionInfo) throws Throwable
OutputStream
for submitting requests to the
server.
pConnectionInfo
- the connection information
Throwable
- if it's not possible to get the output streampublic abstract InputStream getInputStream(ConnectionInfo pConnectionInfo) throws Throwable
InputStream
for reading the response from the
server.
pConnectionInfo
- the connection information
Throwable
- if it's not possible to get the the input streamprotected void finalize() throws Throwable
finalize
in class Object
Throwable
protected static ISerializer createSerializer(String pClassName) throws ClassNotFoundException
pClassName
- the ISerializer
implementation class
ClassNotFoundException
- if the serializer could not be createdpublic boolean isCalling()
isCalling
in interface IConnection
true
if a call is active, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |