ch.ethz.iks.r_osgi.messages
Class DeliverServiceMessage

java.lang.Object
  extended by ch.ethz.iks.r_osgi.messages.RemoteOSGiMessage
      extended by ch.ethz.iks.r_osgi.messages.DeliverServiceMessage

public final class DeliverServiceMessage
extends RemoteOSGiMessage

DeliverServiceMessage is used to bring an OSGi service to a remote machine. The service interface is transferred and if specified, also an abstract class that can contain code that behaves like a smart proxy and moves some methods to the client machine.

Currently, R-OSGi does not check for class dependencies so if an interface method uses custom objects as parameter and it can not be assumed that the client already has these custom objects, they have to be defined as class injections. However, all inner classes of injections and possible inner classes of the abstract class provided as smart proxy object are automatically added to the class injections.

Since:
0.1
Author:
Jan S. Rellermeyer, ETH Zurich.

Field Summary
 
Fields inherited from class ch.ethz.iks.r_osgi.messages.RemoteOSGiMessage
DELIVER_BUNDLE, DELIVER_BUNDLES, DELIVER_SERVICE, LEASE, LEASE_UPDATE, REMOTE_CALL, REMOTE_CALL_RESULT, REMOTE_EVENT, REQUEST_BUNDLE, REQUEST_DEPENDENCIES, REQUEST_SERVICE, STREAM_REQUEST, STREAM_RESULT, TIME_OFFSET, xid
 
Constructor Summary
DeliverServiceMessage()
          Create a new DeliverServiceMessage.
 
Method Summary
 java.lang.String getExports()
          get the exports.
 java.lang.String getImports()
          get the imports.
 java.util.Map getInjections()
          get the list of class injection.
 byte[] getInterfaceClass()
          convenience method to get the bytes of the interface class.
 java.lang.String[] getInterfaceNames()
          get the interface name of the delivered service.
 byte[] getProxyClass()
          convenience method to get the bytes of the smart proxy class.
 java.lang.String getServiceID()
          get the service ID.
 java.lang.String getSmartProxyName()
          get the smart proxy class name.
 void setExports(java.lang.String exports)
          set the exports.
 void setImports(java.lang.String imports)
          set the imports.
 void setInjections(java.util.Map injections)
          set the injections.
 void setInterfaceNames(java.lang.String[] interfaceNames)
          set the interface names.
 void setServiceID(java.lang.String serviceID)
          set the service ID.
 void setSmartProxyName(java.lang.String smartProxyName)
          set the smart proxy name.
 java.lang.String toString()
          String representation for debug outputs.
 void writeBody(java.io.ObjectOutputStream out)
          write the message body to a stream.
 
Methods inherited from class ch.ethz.iks.r_osgi.messages.RemoteOSGiMessage
getFuncID, getXID, parse, readBytes, readStringArray, send, setXID, writeBytes, writeStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeliverServiceMessage

public DeliverServiceMessage()
Create a new DeliverServiceMessage.

Method Detail

writeBody

public void writeBody(java.io.ObjectOutputStream out)
               throws java.io.IOException
write the message body to a stream.

Specified by:
writeBody in class RemoteOSGiMessage
Parameters:
out - the output stream.
Throws:
java.io.IOException - in case of parse errors.

getServiceID

public java.lang.String getServiceID()
get the service ID.

Returns:
the service ID.

setServiceID

public void setServiceID(java.lang.String serviceID)
set the service ID.

Parameters:
serviceID - the service ID.

setInjections

public void setInjections(java.util.Map injections)
set the injections.

Parameters:
injections - the injections.

getInterfaceNames

public java.lang.String[] getInterfaceNames()
get the interface name of the delivered service.

Returns:
the class name of the interface.

setInterfaceNames

public void setInterfaceNames(java.lang.String[] interfaceNames)
set the interface names.

Parameters:
interfaceNames - the interface class names.

getInterfaceClass

public byte[] getInterfaceClass()
convenience method to get the bytes of the interface class.

Returns:
the interface class.

getSmartProxyName

public java.lang.String getSmartProxyName()
get the smart proxy class name.

Returns:
the class name of the smart proxy or null of undefined.

setSmartProxyName

public void setSmartProxyName(java.lang.String smartProxyName)
set the smart proxy name.

Parameters:
smartProxyName - the smart proxy name.

getProxyClass

public byte[] getProxyClass()
convenience method to get the bytes of the smart proxy class.

Returns:
the class or null if undefined.

getInjections

public java.util.Map getInjections()
get the list of class injection.

Returns:
a List of class names.

getImports

public java.lang.String getImports()
get the imports.

Returns:
the imports.

setImports

public void setImports(java.lang.String imports)
set the imports.

Parameters:
imports - the imports.

getExports

public java.lang.String getExports()
get the exports.

Returns:
the exports.

setExports

public void setExports(java.lang.String exports)
set the exports.

Parameters:
exports - the exports.

toString

public java.lang.String toString()
String representation for debug outputs.

Overrides:
toString in class java.lang.Object
Returns:
a string representation.
See Also:
Object.toString()


Copyright © 2009 IKS, ETH Zurich. All Rights Reserved.