|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.services.carbonmanagement.DefaultCarbonManagementServiceImpl
Default implementation of CarbonManagementService Copyright 2002 Sapient
Field Summary | |
private static String |
ARROW
String constant for drawing a text arrow. |
private CarbonManagementServiceConfiguration |
config
Holds the components configuration. |
private org.apache.commons.logging.Log |
log
Provides a handle to Apache-commons logger |
private static String |
NEW_LINE
String constant for generating a new line. |
private static String |
TAB
String constant for a tab without child. |
private static String |
TAB_WITH_CHILD
String constant for a tab with child. |
Constructor Summary | |
DefaultCarbonManagementServiceImpl()
|
Method Summary | |
private void |
appendSubtreeToBuffer(StringBuffer buffer,
Node subtree,
int depth)
Recursive method that does a depth first traversal of the configuration node hierachy, appending the text representation of the subtree to the buffer. |
void |
configure(ComponentConfiguration configuration)
Configures the component. |
int |
getActiveThreadCount()
Retrieves the number of active threads in the JVM |
int |
getActiveThreadGroupCount()
Retrieves the number of active thread groups in the JVM |
int |
getAvailableProcessors()
Retrieves the number of processes available to this JVM |
String |
getDeploymentProperties()
This implementation uses configuration to specify which deployment properties to return. |
String |
getDeploymentProperty(String propertyName)
Returns the value of the specified deployment property. |
Map |
getDeploymentPropertyMap()
This implementation uses configuration to specify which deployment properties to return. |
long |
getFreeMemory()
Retrieves the free memory available to the JVM |
long |
getMaximumMemory()
Retrieves the amount of memory the JVM may attempt to use |
private ThreadGroup |
getRootThreadGroup()
Gets the root thread group in the system. |
long |
getTotalMemory()
Retrieves the amount of memory researved by the JVM |
void |
loadComponent(String componentName)
Loads the component specified by componentName. |
void |
refreshAllComponentConfigurations()
Refreshes all the components loaded in the system. |
void |
refreshAllConfigurations()
Refreshes all configurations loaded in the system. |
void |
refreshConfiguration(String configuationPath)
Forces a configuration to refresh from the store. |
String |
viewConfigurationTree()
Generates an HTML representation of the configuration tree. |
String |
viewConfigurationXML(String configuationPath)
Genereates an Xml representation of the configuration tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.apache.commons.logging.Log log
private CarbonManagementServiceConfiguration config
private static final String TAB
private static final String TAB_WITH_CHILD
private static final String NEW_LINE
private static final String ARROW
Constructor Detail |
public DefaultCarbonManagementServiceImpl()
Method Detail |
public void configure(ComponentConfiguration configuration) throws InvalidConfigurationException
configure
in interface Configurable
configuration
- configuration for this component
InvalidConfigurationException
- indicates an invalid
configurationpublic String viewConfigurationXML(String configuationPath) throws ConfigurationNotFoundException
viewConfigurationXML
in interface CarbonManagementService
configuationPath
- path to configuration to view
ConfigurationNotFoundException
- indicates no configuration
could be found at the given pathpublic String viewConfigurationTree()
viewConfigurationTree
in interface CarbonManagementService
public void refreshAllConfigurations()
CarbonManagementService
refreshAllConfigurations
in interface CarbonManagementService
public void refreshConfiguration(String configuationPath) throws ConfigurationNotFoundException
refreshConfiguration
in interface CarbonManagementService
configuationPath
- path to configuration to refresh.
ConfigurationNotFoundException
- indicates no configuration was
found at the given pathpublic void refreshAllComponentConfigurations()
CarbonManagementService
refreshAllComponentConfigurations
in interface CarbonManagementService
public void loadComponent(String componentName) throws ComponentNotFoundException
CarbonManagementService
loadComponent
in interface CarbonManagementService
componentName
- name of the component to load
ComponentNotFoundException
- if the component is not foundLookup.fetchComponent(java.lang.String)
public String getDeploymentProperties()
getDeploymentProperties
in interface CarbonManagementService
public Map getDeploymentPropertyMap()
getDeploymentPropertyMap
in interface CarbonManagementService
public String getDeploymentProperty(String propertyName)
CarbonManagementService
getDeploymentProperty
in interface CarbonManagementService
propertyName
- name of the property to return
BootStrapper.getDeploymentProperty(java.lang.String)
private void appendSubtreeToBuffer(StringBuffer buffer, Node subtree, int depth)
buffer
- the buffer to extend the subtree tosubtree
- the subtree to appenddepth
- used to determine number of tabs to output before each nodepublic long getFreeMemory()
getFreeMemory
in interface CarbonManagementService
Runtime.freeMemory()
public long getTotalMemory()
getTotalMemory
in interface CarbonManagementService
Runtime.totalMemory()
public long getMaximumMemory()
getMaximumMemory
in interface CarbonManagementService
Runtime.maxMemory()
public int getAvailableProcessors()
getAvailableProcessors
in interface CarbonManagementService
Runtime.availableProcessors()
private ThreadGroup getRootThreadGroup()
public int getActiveThreadCount()
getActiveThreadCount
in interface CarbonManagementService
Thread.activeCount()
public int getActiveThreadGroupCount()
getActiveThreadGroupCount
in interface CarbonManagementService
ThreadGroup.activeGroupCount()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |