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

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

public class DefaultPogamutPlatform
extends Object
implements PogamutPlatform

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

Author:
Ik

Field Summary
protected  MBeanServerConnection mbsc
           
 
Constructor Summary
DefaultPogamutPlatform()
           
 
Method Summary
 void close()
          Used to shutdown the Pogamut platform - currently it only stops JMX.
 boolean getBooleanProperty(String key)
           
 int getIntProperty(String key)
           
 MBeanServer getMBeanServer()
          Returns MBeans server for the Pogamut Platform.
 MBeanServerConnection getMBeanServerConnection()
           
 JMXServiceURL getMBeanServerURL()
           
 String getProperty(String key)
          Returns property value.
 String getProperty(String key, 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 MBeanServerConnection mbsc
Constructor Detail

DefaultPogamutPlatform

public DefaultPogamutPlatform()
Method Detail

getMBeanServerURL

public JMXServiceURL getMBeanServerURL()
                                throws cz.cuni.amis.utils.exception.PogamutException
Specified by:
getMBeanServerURL in interface PogamutPlatform
Throws:
cz.cuni.amis.utils.exception.PogamutException

getRMIPort

protected int getRMIPort()
                  throws cz.cuni.amis.utils.exception.PogamutException
Throws:
cz.cuni.amis.utils.exception.PogamutException

getMBeanServer

public MBeanServer getMBeanServer()
                           throws cz.cuni.amis.utils.exception.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:
cz.cuni.amis.utils.exception.PogamutException

close

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

Specified by:
close in interface PogamutPlatform
Throws:
cz.cuni.amis.utils.exception.PogamutException

getProperty

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

getProperty

public String getProperty(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 MBeanServerConnection getMBeanServerConnection()
                                               throws cz.cuni.amis.utils.exception.PogamutException
Specified by:
getMBeanServerConnection in interface PogamutPlatform
Returns:
Connection to a remote MBeanServer
Throws:
cz.cuni.amis.utils.exception.PogamutException

getIntProperty

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

getBooleanProperty

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


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.