com.bigdata.service
Class DefaultClientDelegate<T>

java.lang.Object
  extended by com.bigdata.service.DefaultClientDelegate<T>
All Implemented Interfaces:
IFederationDelegate<T>

public class DefaultClientDelegate<T>
extends Object
implements IFederationDelegate<T>

Default IFederationDelegate implementation used by a standard client. This may be extended or replaced using AbstractClient.setDelegate(IFederationDelegate).

Version:
$Id: DefaultClientDelegate.java 5997 2012-02-09 12:55:51Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
DefaultClientDelegate(IBigdataClient<?> client, T clientOrService)
           
 
Method Summary
 void didStart()
          NOP
 T getService()
          Return the client or service.
 Class getServiceIface()
          Return the class or interface that is the most interesting facet of the client and which will be used to identify this client in the performance counters reported to the ILoadBalancerService.
 String getServiceName()
          Return a stable identifier for this client based on the name of the implementation class, the hostname, and the hash code of the client (readable and likely to be unique, but uniqueness is not guaranteed).
 UUID getServiceUUID()
          Returns a stable but randomly assigned UUID.
 boolean isServiceReady()
          Returns true.
 AbstractHTTPD newHttpd(int httpdPort, ICounterSetAccess access)
          Create a new AbstractHTTPD instance.
 void reattachDynamicCounters()
          NOP.
 void serviceJoin(IService service, UUID serviceUUID)
          NOP
 void serviceLeave(UUID serviceUUID)
          NOP
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClientDelegate

public DefaultClientDelegate(IBigdataClient<?> client,
                             T clientOrService)
Parameters:
client - The client (before it connects to the federation).
clientOrService - The client or service connected to the federation. This MAY be null but then getService() will also return null.
Method Detail

getService

public T getService()
Description copied from interface: IFederationDelegate
Return the client or service.

Specified by:
getService in interface IFederationDelegate<T>

getServiceUUID

public UUID getServiceUUID()
Returns a stable but randomly assigned UUID.

Specified by:
getServiceUUID in interface IFederationDelegate<T>
See Also:
AbstractService.setServiceUUID(UUID)

getServiceName

public String getServiceName()
Return a stable identifier for this client based on the name of the implementation class, the hostname, and the hash code of the client (readable and likely to be unique, but uniqueness is not guaranteed).

Specified by:
getServiceName in interface IFederationDelegate<T>
Returns:
A name for the service.

getServiceIface

public Class getServiceIface()
Description copied from interface: IFederationDelegate
Return the class or interface that is the most interesting facet of the client and which will be used to identify this client in the performance counters reported to the ILoadBalancerService.

Specified by:
getServiceIface in interface IFederationDelegate<T>
Returns:
The class or interface and never null.

reattachDynamicCounters

public void reattachDynamicCounters()
NOP.

Specified by:
reattachDynamicCounters in interface IFederationDelegate<T>

isServiceReady

public boolean isServiceReady()
Returns true.

Specified by:
isServiceReady in interface IFederationDelegate<T>

didStart

public void didStart()
NOP

Specified by:
didStart in interface IFederationDelegate<T>

serviceJoin

public void serviceJoin(IService service,
                        UUID serviceUUID)
NOP

Specified by:
serviceJoin in interface IFederationDelegate<T>
Parameters:
service - The service.
serviceUUID - The service UUID.

serviceLeave

public void serviceLeave(UUID serviceUUID)
NOP

Specified by:
serviceLeave in interface IFederationDelegate<T>
Parameters:
serviceUUID - The service UUID.

newHttpd

public AbstractHTTPD newHttpd(int httpdPort,
                              ICounterSetAccess access)
                       throws IOException
Description copied from interface: IFederationDelegate
Create a new AbstractHTTPD instance.

Specified by:
newHttpd in interface IFederationDelegate<T>
access - Used to materialize the CounterSet that will be served up.
Returns:
The httpd daemon.
Throws:
IOException


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.