org.caleigo.service
Class ServiceProviderServer.MessageConsumer.ProxyService

java.lang.Object
  extended byorg.caleigo.service.ServiceProviderServer.MessageConsumer.ProxyService
All Implemented Interfaces:
IDistributable, IProxyService, IService, java.io.Serializable
Enclosing class:
ServiceProviderServer.MessageConsumer

protected class ServiceProviderServer.MessageConsumer.ProxyService
extends java.lang.Object
implements IProxyService, java.io.Serializable

This class wrapps an IService and implements the methods in IProxyService. This class is used to provide IProxyService functionallity for a proxy that has been created for a IService that doesn't have a custom proxy service.

See Also:
Serialized Form

Field Summary
protected  IService mService
           
 
Constructor Summary
ServiceProviderServer.MessageConsumer.ProxyService(IService service)
           
 
Method Summary
 void finalizeService()
          This method is always called by the ServiceManager before the service is released.
 IProxyService getCustomProxyService(ITunnel tunnel)
          Returns an IProxyService that is responsible for handling remote invokations of this service.
 java.lang.Object getServiceIdentity()
          Returns the URI defining the a unique individual service.
 java.lang.Object getServiceInterface()
          Returns the service object that this service provides.
 java.lang.Class getServiceInterfaceClass()
          Returns the class object the defines the service interface that all services with the same type provides.
 java.lang.Object getServiceType()
          Returns a URI that defines the type of this service.
 boolean hasCustomProxyService()
          If this method returns true then the method getCustomProxyService must not return null.
 void initializeService()
          This method is always called by the ServiceManager before any other method in the service is called.
 boolean isReconnectable()
          Returns true if this IProxyService can be reconnected to an IService.
 boolean ping()
          Should return true if the service is online and reponding to calls.
 void reconnect(ITunnel tunnel)
          Tries to reconnect to the provided service.
 void setServiceTunnel(ITunnel tunnel)
          Sets the ITunnel that should be used by this IProxyService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mService

protected IService mService
Constructor Detail

ServiceProviderServer.MessageConsumer.ProxyService

public ServiceProviderServer.MessageConsumer.ProxyService(IService service)
Method Detail

initializeService

public void initializeService()
This method is always called by the ServiceManager before any other method in the service is called.

Specified by:
initializeService in interface IService

finalizeService

public void finalizeService()
This method is always called by the ServiceManager before the service is released. No other method calls will then be performed on this instance of the service.

Specified by:
finalizeService in interface IService

ping

public boolean ping()
Should return true if the service is online and reponding to calls. Note that initializeService() must be called prior to this method.

Specified by:
ping in interface IService

getServiceInterface

public java.lang.Object getServiceInterface()
Returns the service object that this service provides. This object should always implement the interface defined by the service interface class.

Specified by:
getServiceInterface in interface IService

getServiceInterfaceClass

public java.lang.Class getServiceInterfaceClass()
Returns the class object the defines the service interface that all services with the same type provides.

Specified by:
getServiceInterfaceClass in interface IService

getServiceType

public java.lang.Object getServiceType()
Returns a URI that defines the type of this service. Note that there can be multiple services implementing the same service type but implementations of a given type must implement the same service interface.

Specified by:
getServiceType in interface IService

getServiceIdentity

public java.lang.Object getServiceIdentity()
Returns the URI defining the a unique individual service.

Specified by:
getServiceIdentity in interface IService

hasCustomProxyService

public boolean hasCustomProxyService()
If this method returns true then the method getCustomProxyService must not return null.

Specified by:
hasCustomProxyService in interface IService

getCustomProxyService

public IProxyService getCustomProxyService(ITunnel tunnel)
Returns an IProxyService that is responsible for handling remote invokations of this service.

Specified by:
getCustomProxyService in interface IService

isReconnectable

public boolean isReconnectable()
Returns true if this IProxyService can be reconnected to an IService.

Specified by:
isReconnectable in interface IProxyService

reconnect

public void reconnect(ITunnel tunnel)
               throws ServiceException
Tries to reconnect to the provided service. If the reconnection fails or if this IProxyService doesn't support reconnection an exception is thrown.

Specified by:
reconnect in interface IProxyService
Throws:
ServiceException

setServiceTunnel

public void setServiceTunnel(ITunnel tunnel)
Sets the ITunnel that should be used by this IProxyService.

Specified by:
setServiceTunnel in interface IProxyService


Copyright © 2005 Caleigo. All Rights Reserved.