org.semispace.admin
Class SemiSpaceAdmin

java.lang.Object
  extended by org.semispace.admin.SemiSpaceAdmin
All Implemented Interfaces:
SemiSpaceAdminInterface

public class SemiSpaceAdmin
extends Object
implements SemiSpaceAdminInterface


Constructor Summary
SemiSpaceAdmin(SemiSpaceInterface terraSpace)
           
 
Method Summary
protected  void assumeAdminResponsibility(boolean sendAdminInfoAboutSystemTime)
           
 long calculateTime()
           
protected  SemiSpaceInterface getSpace()
           
protected  int getSpaceId()
          Used from junit test.
 ExecutorService getThreadPool()
           
 boolean hasBeenInitialized()
           
 boolean isMaster()
           
 void notifyAboutEvent(DistributedEvent event)
          Administrator should get notified about all events.
 void performInitialization()
           
protected  IdentifyAdminQuery populateListOfAllSpaces(List<IdentifyAdminQuery> admins)
          Protected as it is used every once in a while from periodic object reaper
 void removeShutDownHook()
          Remove shutdown hook which otherwise is run when the space is shut down.
protected  void shutdownAndAwaitTermination()
          The cached thread pool has a timeout of a minute, so a shutdown is not immediate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemiSpaceAdmin

public SemiSpaceAdmin(SemiSpaceInterface terraSpace)
Method Detail

getSpaceId

protected int getSpaceId()
Used from junit test.


getSpace

protected SemiSpaceInterface getSpace()
Returns:
space configured for this admin. Beneficiary for subclasses.

getThreadPool

public ExecutorService getThreadPool()
Specified by:
getThreadPool in interface SemiSpaceAdminInterface
Returns:
Executor service used for treating thread elements

hasBeenInitialized

public boolean hasBeenInitialized()
Specified by:
hasBeenInitialized in interface SemiSpaceAdminInterface

isMaster

public boolean isMaster()
Specified by:
isMaster in interface SemiSpaceAdminInterface

calculateTime

public long calculateTime()
Specified by:
calculateTime in interface SemiSpaceAdminInterface

performInitialization

public void performInitialization()
Specified by:
performInitialization in interface SemiSpaceAdminInterface

assumeAdminResponsibility

protected void assumeAdminResponsibility(boolean sendAdminInfoAboutSystemTime)

populateListOfAllSpaces

protected IdentifyAdminQuery populateListOfAllSpaces(List<IdentifyAdminQuery> admins)
Protected as it is used every once in a while from periodic object reaper

Parameters:
admins - List to fill with the admin processes found
Returns:
List of identified SemiSpace admin classes

notifyAboutEvent

public void notifyAboutEvent(DistributedEvent event)
Description copied from interface: SemiSpaceAdminInterface
Administrator should get notified about all events. This can be used for attaching persistence engine.

Specified by:
notifyAboutEvent in interface SemiSpaceAdminInterface

shutdownAndAwaitTermination

protected void shutdownAndAwaitTermination()
The cached thread pool has a timeout of a minute, so a shutdown is not immediate. This method will try to speed up the process, but it is not mandatory to use it. The method is protected for the benefit of subclasses.


removeShutDownHook

public void removeShutDownHook()
Remove shutdown hook which otherwise is run when the space is shut down. Primarily used when exchanging this admin with another.



Copyright © 2008-2012. All Rights Reserved.