org.beanfabrics.context
Class ServiceEntry

java.lang.Object
  extended by org.beanfabrics.context.ServiceEntry

public class ServiceEntry
extends java.lang.Object

A ServiceEntry describes the attributes of a service entry in a specific context. It provides access to the service itself as well as information about the location, the type and the distance.


Constructor Summary
ServiceEntry(int distance, Context origin, java.lang.Object service, java.lang.Class<?> type)
          Constructs a ServiceEntry.
 
Method Summary
 int getDistance()
          Returns the distance, where distance is defined as the number of hierarchical steps between the owner context and the context the service was originally placed into.
 Context getOrigin()
          Returns the context where the service was originally placed into.
 java.lang.Object getService()
          Returns the service implementation.
 java.lang.Class<?> getType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceEntry

public ServiceEntry(int distance,
                    Context origin,
                    java.lang.Object service,
                    java.lang.Class<?> type)
Constructs a ServiceEntry.

Parameters:
distance - the distance is defined as the number of hierarchical steps between the owner context and the context the service was originally placed into.
origin - the context the service was originally placed into
service - the service implementation
type - the service type that will be used as the lookup key
Method Detail

getOrigin

public Context getOrigin()
Returns the context where the service was originally placed into.

Returns:
the context where the service was originally placed into

getDistance

public int getDistance()
Returns the distance, where distance is defined as the number of hierarchical steps between the owner context and the context the service was originally placed into.

Returns:
the distance

getService

public java.lang.Object getService()
Returns the service implementation.

Returns:
the service implementation

getType

public java.lang.Class<?> getType()