com.bigdata.service.jini
Class LoadBalancerServer.AdministrableLoadBalancer

java.lang.Object
  extended by com.bigdata.service.AbstractService
      extended by com.bigdata.service.LoadBalancerService
          extended by com.bigdata.service.jini.LoadBalancerServer.AdministrableLoadBalancer
All Implemented Interfaces:
IEventReceivingService, IEventReportingService, ILoadBalancerService, IService, IServiceShutdown, RemoteAdministrable, RemoteDestroyAdmin, com.sun.jini.admin.DestroyAdmin, Remote, net.jini.admin.Administrable
Enclosing class:
LoadBalancerServer

public static class LoadBalancerServer.AdministrableLoadBalancer
extends LoadBalancerService
implements RemoteAdministrable, RemoteDestroyAdmin

Adds jini administration interfaces to the basic LoadBalancerService.

Version:
$Id$
Author:
Bryan Thompson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bigdata.service.LoadBalancerService
LoadBalancerService.Options, LoadBalancerService.RoundRobinServiceLoadHelper, LoadBalancerService.ServiceLoadHelperWithoutScores, LoadBalancerService.ServiceLoadHelperWithScores, LoadBalancerService.UpdateTask
 
Field Summary
protected  LoadBalancerServer server
           
 
Fields inherited from class com.bigdata.service.LoadBalancerService
activeDataServices, activeHosts, eventReceiver, eventStore, historyMinutes, hostScores, initialRoundRobinUpdateCount, isTransient, joined, lock, log, logDir, nupdates, ps, serviceJoinTimeout, serviceScores, updateService
 
Constructor Summary
LoadBalancerServer.AdministrableLoadBalancer(LoadBalancerServer server, Properties properties)
           
 
Method Summary
protected  void clearLoggingContext()
          Clear the logging context.
 void destroy()
          Destroy the service.
 Object getAdmin()
           
protected  String getClientHostname()
          Note: InetAddress.getHostName() is used.
 JiniFederation<?> getFederation()
          Return the proxy used to access other services in the federation.
 String getServiceName()
          Extends the base behavior to return a Name of the service from the Configuration.
protected  void setupLoggingContext()
          Adds the following parameters to the MDC clientname The hostname or IP address of the client making the request (at #log.isInfoEnabled() or better)
 void shutdown()
          The service will no longer accept new requests, but existing requests will be processed (sychronous).
 void shutdownNow()
          The service will no longer accept new requests and will make a best effort attempt to terminate all existing requests and return ASAP.
 
Methods inherited from class com.bigdata.service.LoadBalancerService
finalized, getProperties, getServiceIface, getUnderUtilizedDataService, getUnderUtilizedDataServices, isHighlyUtilizedDataService, isHighlyUtilizedDataService, isOpen, isUnderUtilizedDataService, isUnderUtilizedDataService, join, leave, logCounters, logCounters, logCounters, notify, notifyEvent, rangeCount, rangeIterator, setHostScores, setServiceScores, sighup, start, urgent, warn
 
Methods inherited from class com.bigdata.service.AbstractService
getHostname, getServiceUUID, setServiceUUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bigdata.service.IService
getHostname, getServiceUUID
 

Field Detail

server

protected final LoadBalancerServer server
Constructor Detail

LoadBalancerServer.AdministrableLoadBalancer

public LoadBalancerServer.AdministrableLoadBalancer(LoadBalancerServer server,
                                                    Properties properties)
Method Detail

getFederation

public JiniFederation<?> getFederation()
Description copied from class: AbstractService
Return the proxy used to access other services in the federation.

Specified by:
getFederation in class AbstractService

getAdmin

public Object getAdmin()
                throws RemoteException
Specified by:
getAdmin in interface net.jini.admin.Administrable
Throws:
RemoteException

setupLoggingContext

protected void setupLoggingContext()
Adds the following parameters to the MDC
clientname
The hostname or IP address of the client making the request (at #log.isInfoEnabled() or better)

Overrides:
setupLoggingContext in class AbstractService

clearLoggingContext

protected void clearLoggingContext()
Description copied from class: AbstractService
Clear the logging context.

Overrides:
clearLoggingContext in class AbstractService

destroy

public void destroy()
Description copied from interface: IService
Destroy the service. If the service is running, it is shutdown immediately and then destroyed. This method has the same signature as DestroyAdmin.destroy().

Specified by:
destroy in interface IService
Specified by:
destroy in interface RemoteDestroyAdmin
Specified by:
destroy in interface com.sun.jini.admin.DestroyAdmin
Overrides:
destroy in class LoadBalancerService

shutdown

public void shutdown()
Description copied from interface: IServiceShutdown
The service will no longer accept new requests, but existing requests will be processed (sychronous). This method should await the termination of pending requests, but no longer than the timeout specified by IServiceShutdown.Options.SHUTDOWN_TIMEOUT. Implementations SHOULD be synchronized. If the service is aleady shutdown, then this method should be a NOP.

Specified by:
shutdown in interface IServiceShutdown
Specified by:
shutdown in interface RemoteDestroyAdmin
Overrides:
shutdown in class LoadBalancerService

shutdownNow

public void shutdownNow()
Description copied from interface: IServiceShutdown
The service will no longer accept new requests and will make a best effort attempt to terminate all existing requests and return ASAP. This method should terminate any asynchronous processing, release all resources and return immediately. Implementations SHOULD be synchronized. If the service is aleady shutdown, then this method should be a NOP.

Specified by:
shutdownNow in interface IServiceShutdown
Specified by:
shutdownNow in interface RemoteDestroyAdmin
Overrides:
shutdownNow in class LoadBalancerService

getClientHostname

protected String getClientHostname()
Note: InetAddress.getHostName() is used. This method makes a one-time best effort attempt to resolve the host name from the InetAddress.

Specified by:
getClientHostname in class LoadBalancerService
TODO:
we could pass the class ClientSubject to obtain the authenticated identity of the client (if any) for an incoming remote call.

getServiceName

public String getServiceName()
Extends the base behavior to return a Name of the service from the Configuration. If no name was specified in the Configuration then the value returned by the base class is returned instead.

Specified by:
getServiceName in interface IService
Overrides:
getServiceName in class AbstractService


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