cz.cuni.amis.pogamut.base.utils
Class DefaultPogamutPlatform

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.utils.DefaultPogamutPlatform
All Implemented Interfaces:
PogamutPlatform

public class DefaultPogamutPlatform
extends java.lang.Object
implements PogamutPlatform

Singleton for platform wide settings like: JMX, properties loading.


Field Summary
protected  javax.management.MBeanServerConnection mbsc
           
 
Constructor Summary
DefaultPogamutPlatform()
           
 
Method Summary
 void close()
          Used to shutdown the Pogamut platform - currently it only stops JMX.
 boolean getBooleanProperty(java.lang.String key)
           
 int getIntProperty(java.lang.String key)
           
 javax.management.MBeanServer getMBeanServer()
          Returns MBeans server for the Pogamut Platform.
 javax.management.MBeanServerConnection getMBeanServerConnection()
           
 javax.management.remote.JMXServiceURL getMBeanServerURL()
           
 java.lang.String getProperty(java.lang.String key)
          Returns property value.
 java.lang.String getProperty(java.lang.String key, java.lang.String def)
           
protected  int getRMIPort()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mbsc

protected javax.management.MBeanServerConnection mbsc
Constructor Detail

DefaultPogamutPlatform

public DefaultPogamutPlatform()
Method Detail

getMBeanServerURL

public javax.management.remote.JMXServiceURL getMBeanServerURL()
                                                        throws PogamutException
Specified by:
getMBeanServerURL in interface PogamutPlatform
Throws:
PogamutException

getRMIPort

protected int getRMIPort()
                  throws PogamutException
Throws:
PogamutException

getMBeanServer

public javax.management.MBeanServer getMBeanServer()
                                            throws PogamutException
Returns MBeans server for the Pogamut Platform. All MBeans connected from the platform should be registered in this server. There is also default RMI connector for this server running on service:jmx:rmi:///jndi/rmi://localhost:9999/server

Specified by:
getMBeanServer in interface PogamutPlatform
Returns:
Throws:
PogamutException

close

public void close()
           throws PogamutException
Description copied from interface: PogamutPlatform
Used to shutdown the Pogamut platform - currently it only stops JMX.

Specified by:
close in interface PogamutPlatform
Throws:
PogamutException

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String def)
Specified by:
getProperty in interface PogamutPlatform
Parameters:
key -
def -
Returns:
See Also:
DefaultPogamutPlatform.getProperty(String)

getProperty

public java.lang.String getProperty(java.lang.String key)
Returns property value. The search order for finding the value is determined dynamicaly by the SPI. There are allways these sources of properties that are accesed in this order:
  1. Get property from -D option supplied when running the JVM
  2. Get the property from system properties (eg. specified by set MY_PROP=hello)
  3. Load property from PogamutPlatformCustom.properties file in processe's working directory
  4. Load property from default platform property file inside Gavialib
However other sources may be added through SPI.

Specified by:
getProperty in interface PogamutPlatform
Parameters:
key -
Returns:
null if no such property was found

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection()
                                                                throws PogamutException
Specified by:
getMBeanServerConnection in interface PogamutPlatform
Returns:
Connection to a remote MBeanServer
Throws:
PogamutException

getIntProperty

public int getIntProperty(java.lang.String key)
Specified by:
getIntProperty in interface PogamutPlatform

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key)
Specified by:
getBooleanProperty in interface PogamutPlatform