org.sapia.ubik.rmi.server.transport.socket
Class SocketRmiConnection

java.lang.Object
  extended by org.sapia.ubik.net.SocketConnection
      extended by org.sapia.ubik.rmi.server.transport.socket.SocketRmiConnection
All Implemented Interfaces:
Connection, RmiConnection

public class SocketRmiConnection
extends SocketConnection
implements RmiConnection

A connection over a Socket - the connection uses the MarshalOutputStream class to serialize outgoing objects.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Field Summary
 
Fields inherited from class org.sapia.ubik.net.SocketConnection
_address, _is, _lastReset, _loader, _os, _resetInterval, _sock
 
Constructor Summary
SocketRmiConnection(java.net.Socket sock)
          Constructor for RMIConnection.
SocketRmiConnection(java.net.Socket sock, java.lang.ClassLoader loader)
          Constructor for RMIConnection.
 
Method Summary
protected  java.io.ObjectInputStream newInputStream(java.io.InputStream is, java.lang.ClassLoader loader)
          Template method internally called by this instance; the method should create an ObjectInputStream for the given parameters.
protected  java.io.ObjectOutputStream newOutputStream(java.io.OutputStream os, java.lang.ClassLoader loader)
          Template method internally called by this instance; the method should create an ObjectOutputStream for the given parameters.
 void send(java.lang.Object o, VmId vmId, java.lang.String tranportType)
           
 
Methods inherited from class org.sapia.ubik.net.SocketConnection
close, doSend, getInputStream, getOuputStream, getServerAddress, readHeader, receive, send, setResetInterval, writeHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sapia.ubik.net.Connection
close, getServerAddress, receive, send
 

Constructor Detail

SocketRmiConnection

public SocketRmiConnection(java.net.Socket sock,
                           java.lang.ClassLoader loader)
Constructor for RMIConnection.

Parameters:
sock -
loader -

SocketRmiConnection

public SocketRmiConnection(java.net.Socket sock)
Constructor for RMIConnection.

Parameters:
sock -
Method Detail

send

public void send(java.lang.Object o,
                 VmId vmId,
                 java.lang.String tranportType)
          throws java.io.IOException,
                 java.rmi.RemoteException
Specified by:
send in interface RmiConnection
Throws:
java.io.IOException
java.rmi.RemoteException
See Also:
RmiConnection.send(Object, VmId, String)

newOutputStream

protected java.io.ObjectOutputStream newOutputStream(java.io.OutputStream os,
                                                     java.lang.ClassLoader loader)
                                              throws java.io.IOException
Description copied from class: SocketConnection
Template method internally called by this instance; the method should create an ObjectOutputStream for the given parameters.

Overrides:
newOutputStream in class SocketConnection
Parameters:
os - the OutputStream that the returned stream should wrap.
Returns:
an ObjectOutputStream.
Throws:
java.io.IOException - if a problem occurs creating the desired object.
See Also:
SocketConnection.newOutputStream(OutputStream, ClassLoader)

newInputStream

protected java.io.ObjectInputStream newInputStream(java.io.InputStream is,
                                                   java.lang.ClassLoader loader)
                                            throws java.io.IOException
Description copied from class: SocketConnection
Template method internally called by this instance; the method should create an ObjectInputStream for the given parameters.

The returned instance can use the passed in classloader to resolve the classes of the deserialized objects.

Overrides:
newInputStream in class SocketConnection
Parameters:
is - the InputStream that the returned stream should wrap.
Returns:
an ObjectInputStream.
Throws:
java.io.IOException - if a problem occurs creating the desired object.
See Also:
SocketConnection.newInputStream(InputStream, ClassLoader)


Copyright © 2010 Sapia OSS. All Rights Reserved.