Groovy Documentation

org.linkedin.glu.agent.server
[Groovy] Class AgentMain

java.lang.Object
  org.linkedin.glu.agent.server.AgentMain

class AgentMain

This is the main class to start the agent.

Authors:
ypujante@linkedin.com


Field Summary
static java.lang.String MODULE

protected AgentImpl _agent

protected AgentContextImpl _agentContext

protected java.lang.String _agentName

protected AgentProperties _agentProperties

protected java.io.File _agentTempDir

protected java.lang.Object _config

protected DualWriteStorage _dwStorage

protected java.lang.String _fabric

protected java.lang.Object _lock

protected java.io.File _persistentPropertiesFile

protected long _pid

protected Agent _proxiedAgent

protected boolean _receivedShutdown

protected java.lang.Object _restServer

protected java.lang.Shutdown _shutdown

protected Sigar _sigar

protected Storage _storage

protected java.lang.Object _urlFactory

protected IZKClient _zkClient

protected java.lang.String _zooKeeperRoot

protected groovy.lang.Closure hostnameFactory

static java.lang.Object log

 
Property Summary
java.lang.Object stop

 
Constructor Summary
AgentMain()

 
Method Summary
java.lang.Object awaitTermination()

protected java.lang.String computeAgentEphemeralPath()

protected java.lang.String computeFabric(java.lang.Object configFromCli, java.lang.Object config)

Computes the fabric

protected java.lang.Object computeHostnameFactory(java.util.Properties config)

Use the glu.agent.hostname config value to determine how to compute hostname.

protected java.lang.String computeZKAgentFabricPath()

protected java.lang.String computeZooKeeperStoragePath()

void configure(java.util.Map config)

protected CommandManager createCommandsManager(ShellImpl rootShell, ScriptManager scriptManager, AbstractScriptFactoryFactory scriptFactoryFactory)

protected ShellImpl createRootShell()

protected Shell createShell(ShellImpl rootShell, java.lang.String root)

protected Sigar createSigar()

Create Sigar.

protected Storage createStorage()

protected IZKClient createZooKeeperClient(java.lang.Object config)

protected ZooKeeperStorage createZooKeeperStorage()

protected java.io.File fetchFile(java.lang.Object fileLocation, java.lang.Object checksum)

java.lang.String getAgentName()

protected long getAgentPid()

java.lang.String getFabric()

protected java.lang.Object getOneWayCodec()

protected java.lang.String getPassword(java.lang.Object config, java.lang.String name)

java.lang.String getPrefix()

protected java.lang.Object getRemoteConfigCodec()

protected java.lang.Object getTwoWayCodec()

java.lang.Object getUrlFactory()

java.lang.String getZookeeperRoot()

void init(java.lang.Object args)

java.io.File loadPersistentProperties(java.util.Properties config, java.util.Properties persistentProperties)

Loads the persistent properties which will serve as default values for whatever is not specified.

static void main(java.lang.Object args)

protected java.util.Properties mergeConfig(java.util.Properties higherPriorityConfig, java.util.Properties lowerPriorityConfig)

The goal of this method is to merge the configuration in the following fashion: all properties that are in the higherPriority bucket will override any that are in the other bucket

void onConnected()

void onDisconnected()

protected java.lang.Object readConfig(java.lang.Object url, java.util.Properties properties)

java.lang.Object registerTerminationHandler()

java.io.File savePersistentProperties(java.lang.Object config, AgentProperties agentProperties)

void setUrlFactory(java.lang.Object urlFactory)

java.lang.Object start()

java.lang.Object start(boolean withTerminationHandler)

java.lang.Object startAndWait()

java.lang.Object startRestServer()

static java.lang.Object staticReadConfig(java.lang.Object url, java.util.Properties properties)

protected void toCanonicalPath(java.lang.Object config, java.lang.Object name)

Make sure that the paths are canonical (no .. or links)

protected void toCanonicalPath(java.util.Properties config)

Make sure that the paths are canonical (no .. or links)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

MODULE

public static final java.lang.String MODULE


_agent

protected AgentImpl _agent


_agentContext

protected AgentContextImpl _agentContext


_agentName

protected java.lang.String _agentName


_agentProperties

protected AgentProperties _agentProperties


_agentTempDir

protected java.io.File _agentTempDir


_config

protected java.lang.Object _config


_dwStorage

protected DualWriteStorage _dwStorage


_fabric

protected java.lang.String _fabric


_lock

protected final java.lang.Object _lock


_persistentPropertiesFile

protected java.io.File _persistentPropertiesFile


_pid

protected long _pid


_proxiedAgent

protected Agent _proxiedAgent


_receivedShutdown

protected boolean _receivedShutdown


_restServer

protected java.lang.Object _restServer


_shutdown

protected java.lang.Shutdown _shutdown


_sigar

protected Sigar _sigar


_storage

protected Storage _storage


_urlFactory

protected java.lang.Object _urlFactory


_zkClient

protected IZKClient _zkClient


_zooKeeperRoot

protected java.lang.String _zooKeeperRoot


hostnameFactory

protected groovy.lang.Closure hostnameFactory


log

public static final java.lang.Object log


 
Property Detail

stop

java.lang.Object stop


 
Constructor Detail

AgentMain

AgentMain()


 
Method Detail

awaitTermination

java.lang.Object awaitTermination()


computeAgentEphemeralPath

protected java.lang.String computeAgentEphemeralPath()


computeFabric

protected java.lang.String computeFabric(java.lang.Object configFromCli, java.lang.Object config)
Computes the fabric


computeHostnameFactory

protected java.lang.Object computeHostnameFactory(java.util.Properties config)
Use the glu.agent.hostname config value to determine how to compute hostname.


computeZKAgentFabricPath

protected java.lang.String computeZKAgentFabricPath()


computeZooKeeperStoragePath

protected java.lang.String computeZooKeeperStoragePath()


configure

@Override
void configure(java.util.Map config)


createCommandsManager

protected CommandManager createCommandsManager(ShellImpl rootShell, ScriptManager scriptManager, AbstractScriptFactoryFactory scriptFactoryFactory)


createRootShell

protected ShellImpl createRootShell()


createShell

protected Shell createShell(ShellImpl rootShell, java.lang.String root)


createSigar

protected Sigar createSigar()
Create Sigar.


createStorage

protected Storage createStorage()


createZooKeeperClient

protected IZKClient createZooKeeperClient(java.lang.Object config)


createZooKeeperStorage

protected ZooKeeperStorage createZooKeeperStorage()


fetchFile

protected java.io.File fetchFile(java.lang.Object fileLocation, java.lang.Object checksum)


getAgentName

java.lang.String getAgentName()


getAgentPid

protected long getAgentPid()


getFabric

java.lang.String getFabric()


getOneWayCodec

protected java.lang.Object getOneWayCodec()


getPassword

protected java.lang.String getPassword(java.lang.Object config, java.lang.String name)


getPrefix

java.lang.String getPrefix()


getRemoteConfigCodec

protected java.lang.Object getRemoteConfigCodec()


getTwoWayCodec

protected java.lang.Object getTwoWayCodec()


getUrlFactory

java.lang.Object getUrlFactory()


getZookeeperRoot

java.lang.String getZookeeperRoot()


init

void init(java.lang.Object args)


loadPersistentProperties

java.io.File loadPersistentProperties(java.util.Properties config, java.util.Properties persistentProperties)
Loads the persistent properties which will serve as default values for whatever is not specified.
Parameters:
config - to determine if/where to load the persistent properties from (this object will *not* be modified by this method)
persistentProperties - will be populated with the persistent properties
Returns:
the file they were loaded from (to write to it) or null if we should not store any persistent properties


main

static void main(java.lang.Object args)


mergeConfig

protected java.util.Properties mergeConfig(java.util.Properties higherPriorityConfig, java.util.Properties lowerPriorityConfig)
The goal of this method is to merge the configuration in the following fashion: all properties that are in the higherPriority bucket will override any that are in the other bucket
Returns:
always a new object with the merged properties


onConnected

void onConnected()


onDisconnected

void onDisconnected()


readConfig

protected java.lang.Object readConfig(java.lang.Object url, java.util.Properties properties)


registerTerminationHandler

java.lang.Object registerTerminationHandler()


savePersistentProperties

java.io.File savePersistentProperties(java.lang.Object config, AgentProperties agentProperties)


setUrlFactory

void setUrlFactory(java.lang.Object urlFactory)


start

java.lang.Object start()


start

java.lang.Object start(boolean withTerminationHandler)


startAndWait

java.lang.Object startAndWait()


startRestServer

java.lang.Object startRestServer()


staticReadConfig

static java.lang.Object staticReadConfig(java.lang.Object url, java.util.Properties properties)


toCanonicalPath

protected void toCanonicalPath(java.lang.Object config, java.lang.Object name)
Make sure that the paths are canonical (no .. or links)
Parameters:
config
name


toCanonicalPath

protected void toCanonicalPath(java.util.Properties config)
Make sure that the paths are canonical (no .. or links)
Parameters:
config


 

Groovy Documentation