GigaSpaces XAP 9.7.2 API

org.openspaces.pu.container.jee.lb.apache
Class ApacheLoadBalancerAgent

java.lang.Object
  extended by org.openspaces.pu.container.jee.lb.apache.ApacheLoadBalancerAgent
All Implemented Interfaces:
Runnable, EventListener, DiscoveryListener, ServiceDiscoveryListener

public class ApacheLoadBalancerAgent
extends Object
implements DiscoveryListener, ServiceDiscoveryListener, Runnable

Experimental support for automatically refreshing apache load balancer.

Note, internal API here on how to find processing units is subject to change.

Author:
kimchy

Constructor Summary
ApacheLoadBalancerAgent()
           
 
Method Summary
 void discarded(DiscoveryEvent event)
          Called when one or more lookup service registrars has been discarded.
 void discovered(DiscoveryEvent event)
          Called when one or more lookup service registrars has been discovered.
 String getApachectlLocation()
           
 String getConfigLocation()
           
 String[] getGroups()
           
 String getLocators()
           
 String getRestartCommand()
           
 int getUpdateInterval()
           
static void main(String[] args)
           
static void printUsage()
           
 void run()
           
 void serviceAdded(ServiceDiscoveryEvent event)
          When the cache receives from one of the managed lookup services, an event signaling the registration of a service of interest for the first time (or for the first time since the service has been discarded), the cache invokes the serviceAdded method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discovered.
 void serviceChanged(ServiceDiscoveryEvent event)
          When the cache receives, from a managed lookup service, an event signaling the unique modification of the attributes of a service of interest (across the attribute sets of all references to the service), the cache invokes the serviceChanged method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that the state of a service of interest has changed.
 void serviceRemoved(ServiceDiscoveryEvent event)
          When the cache receives, from a managed lookup service, an event signaling the removal of a service of interest from the last such lookup service with which it was registered, the cache invokes the serviceRemoved method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discarded.
 void setApachectlLocation(String apachectlLocation)
           
 void setConfigLocation(String configLocation)
           
 void setGroups(String[] groups)
           
 void setLocators(String locators)
           
 void setRestartCommand(String restartCommand)
           
 void setUpdateInterval(int updateInterval)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApacheLoadBalancerAgent

public ApacheLoadBalancerAgent()
Method Detail

getGroups

public String[] getGroups()

setGroups

public void setGroups(String[] groups)

getLocators

public String getLocators()

setLocators

public void setLocators(String locators)

getApachectlLocation

public String getApachectlLocation()

setApachectlLocation

public void setApachectlLocation(String apachectlLocation)

getConfigLocation

public String getConfigLocation()

setConfigLocation

public void setConfigLocation(String configLocation)

getUpdateInterval

public int getUpdateInterval()

setUpdateInterval

public void setUpdateInterval(int updateInterval)

getRestartCommand

public String getRestartCommand()

setRestartCommand

public void setRestartCommand(String restartCommand)

start

public void start()
           throws Exception
Throws:
Exception

stop

public void stop()

discovered

public void discovered(DiscoveryEvent event)
Description copied from interface: DiscoveryListener
Called when one or more lookup service registrars has been discovered. The method should return quickly; e.g., it should not make remote calls.

Specified by:
discovered in interface DiscoveryListener
Parameters:
event - the event that describes the discovered registrars

discarded

public void discarded(DiscoveryEvent event)
Description copied from interface: DiscoveryListener
Called when one or more lookup service registrars has been discarded. The method should return quickly; e.g., it should not make remote calls.

Specified by:
discarded in interface DiscoveryListener
Parameters:
event - the event that describes the discarded registrars

serviceAdded

public void serviceAdded(ServiceDiscoveryEvent event)
Description copied from interface: ServiceDiscoveryListener
When the cache receives from one of the managed lookup services, an event signaling the registration of a service of interest for the first time (or for the first time since the service has been discarded), the cache invokes the serviceAdded method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discovered.

Specified by:
serviceAdded in interface ServiceDiscoveryListener
Parameters:
event - an instance of ServiceDiscoveryEvent containing references to the service item corresponding to the event, including representations of the service's state both before and after the event.

serviceRemoved

public void serviceRemoved(ServiceDiscoveryEvent event)
Description copied from interface: ServiceDiscoveryListener
When the cache receives, from a managed lookup service, an event signaling the removal of a service of interest from the last such lookup service with which it was registered, the cache invokes the serviceRemoved method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discarded.

Specified by:
serviceRemoved in interface ServiceDiscoveryListener
Parameters:
event - a ServiceDiscoveryEvent object containing references to the service item corresponding to the event, including representations of the service's state both before and after the event.

serviceChanged

public void serviceChanged(ServiceDiscoveryEvent event)
Description copied from interface: ServiceDiscoveryListener
When the cache receives, from a managed lookup service, an event signaling the unique modification of the attributes of a service of interest (across the attribute sets of all references to the service), the cache invokes the serviceChanged method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that the state of a service of interest has changed.

Specified by:
serviceChanged in interface ServiceDiscoveryListener
Parameters:
event - a ServiceDiscoveryEvent object containing references to the service item corresponding to the event, including representations of the service's state both before and after the event.

run

public void run()
Specified by:
run in interface Runnable

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

printUsage

public static void printUsage()

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.