Brooklyn

brooklyn.event.feed.jmx
[Java] Class JmxHelper

java.lang.Object
  brooklyn.event.feed.jmx.JmxHelper

public class JmxHelper

Field Summary
static java.util.Map CLASSES

static java.lang.String JMXMP_URL_FORMAT

static java.lang.String JMX_URL_FORMAT

static java.lang.String RMI_JMX_URL_FORMAT

 
Constructor Summary
JmxHelper(EntityLocal entity)

JmxHelper(java.lang.String url)

JmxHelper(java.lang.String url, java.lang.String user, java.lang.String password)

JmxHelper(java.lang.String url, EntityLocal entity, java.lang.String user, java.lang.String password)

 
Method Summary
void addNotificationListener(java.lang.String objectName, javax.management.NotificationListener listener)

void addNotificationListener(java.lang.String objectName, javax.management.NotificationListener listener, javax.management.NotificationFilter filter)

void addNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener)

void addNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener, javax.management.NotificationFilter filter)

void assertMBeanExistsEventually(javax.management.ObjectName objectName, Duration timeout)

Returns a specific attribute for a JMX javax.management.ObjectName.

void assertMBeanExistsEventually(javax.management.ObjectName objectName, groovy.time.TimeDuration timeout)

void assertMBeanExistsEventually(javax.management.ObjectName objectName, long timeoutMillis)

void assertMBeanExistsEventually(javax.management.ObjectName objectName, long timeout, java.util.concurrent.TimeUnit timeUnit)

void connect()

attempts to connect immediately

boolean connect(long timeoutMs)

Continuously attempts to connect for at least the indicated amount of time; or indefinitely if -1.

static javax.management.ObjectName createObjectName(java.lang.String name)

void disconnect()

java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, Duration timeout)

returns set of beans found, with retry, empty set if none after timeout

java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, groovy.time.TimeDuration timeout)

java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, long timeoutMillis)

java.util.Set doesMBeanExistsEventually(java.lang.String objectName, Duration timeout)

java.util.Set doesMBeanExistsEventually(java.lang.String objectName, groovy.time.TimeDuration timeout)

java.util.Set doesMBeanExistsEventually(java.lang.String objectName, long timeout, java.util.concurrent.TimeUnit timeUnit)

java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, long timeout, java.util.concurrent.TimeUnit timeUnit)

javax.management.ObjectInstance findMBean(javax.management.ObjectName objectName)

java.util.Set findMBeans(javax.management.ObjectName objectName)

java.lang.Object getAttribute(javax.management.ObjectName objectName, java.lang.String attribute)

protected javax.management.MBeanServerConnection getConnection()

java.util.Map getConnectionEnvVars()

M getProxyObject(java.lang.String objectName, java.lang.Class mbeanInterface)

M getProxyObject(javax.management.ObjectName objectName, java.lang.Class mbeanInterface)

java.lang.String getUrl()

boolean isConnected()

Reconnects.

java.lang.Object operation(java.lang.String objectName, java.lang.String method, java.lang.Object... arguments)

java.lang.Object operation(javax.management.ObjectName objectName, java.lang.String method, java.lang.Object... arguments)

void reconnect()

void reconnectWithRetryDampened()

void removeNotificationListener(java.lang.String objectName, javax.management.NotificationListener listener)

void removeNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener)

void removeNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener, javax.management.NotificationFilter filter)

void setAttribute(java.lang.String objectName, java.lang.String attribute, java.lang.Object val)

@see #operation(ObjectName, String, Object ...)

void setAttribute(javax.management.ObjectName objectName, java.lang.String attribute, java.lang.Object val)

void setMinTimeBetweenReconnectAttempts(int val)

static java.lang.String toConnectorUrl(java.lang.String host, java.lang.Integer jmxRmiServerPort, java.lang.Integer rmiRegistryPort, java.lang.String context)

@deprecated since 0.6.0 use toJmxUrl(EntityLocal)

static java.lang.String toConnectorUrl(EntityLocal entity)

static java.lang.String toJmxUrl(EntityLocal entity)

constructs a JMX URL suitable for connecting to the given entity, being smart about JMX/RMI vs JMXMP

static java.lang.String toJmxmpUrl(java.lang.String host, java.lang.Integer jmxmpPort)

constructs a JMXMP URL for connecting to the given host and port

javax.management.ObjectName toLiteralObjectName(javax.management.ObjectName objectName)

static java.lang.String toRmiJmxUrl(java.lang.String host, java.lang.Integer jmxRmiServerPort, java.lang.Integer rmiRegistryPort, java.lang.String context)

constructs an RMI/JMX URL with the given inputs (where the RMI Registry Port should be non-null, and at least one must be non-null)

 
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

CLASSES

public static final java.util.Map CLASSES


JMXMP_URL_FORMAT

public static final java.lang.String JMXMP_URL_FORMAT


JMX_URL_FORMAT

public static final java.lang.String JMX_URL_FORMAT


RMI_JMX_URL_FORMAT

public static final java.lang.String RMI_JMX_URL_FORMAT


 
Constructor Detail

JmxHelper

public JmxHelper(EntityLocal entity)


JmxHelper

public JmxHelper(java.lang.String url)


JmxHelper

public JmxHelper(java.lang.String url, java.lang.String user, java.lang.String password)


JmxHelper

public JmxHelper(java.lang.String url, EntityLocal entity, java.lang.String user, java.lang.String password)


 
Method Detail

addNotificationListener

public void addNotificationListener(java.lang.String objectName, javax.management.NotificationListener listener)


addNotificationListener

public void addNotificationListener(java.lang.String objectName, javax.management.NotificationListener listener, javax.management.NotificationFilter filter)


addNotificationListener

public void addNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener)


addNotificationListener

public void addNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener, javax.management.NotificationFilter filter)


assertMBeanExistsEventually

public void assertMBeanExistsEventually(javax.management.ObjectName objectName, Duration timeout)
Returns a specific attribute for a JMX javax.management.ObjectName.


assertMBeanExistsEventually

public void assertMBeanExistsEventually(javax.management.ObjectName objectName, groovy.time.TimeDuration timeout)


assertMBeanExistsEventually

public void assertMBeanExistsEventually(javax.management.ObjectName objectName, long timeoutMillis)


assertMBeanExistsEventually

public void assertMBeanExistsEventually(javax.management.ObjectName objectName, long timeout, java.util.concurrent.TimeUnit timeUnit)


connect

//this is a break of contract with the JMXConnectorFactory.connect method, so this code verifies if the NPE is
public void connect()
attempts to connect immediately


connect

public boolean connect(long timeoutMs)
Continuously attempts to connect for at least the indicated amount of time; or indefinitely if -1. This method is useful when you are not sure if the system you are trying to connect to already is up and running. This method doesn't throw an Exception, but returns true on success, false otherwise. TODO: What happens if already connected?
Parameters:
timeoutMs
Returns:


createObjectName

public static javax.management.ObjectName createObjectName(java.lang.String name)


disconnect

public void disconnect()


doesMBeanExistsEventually

public java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, Duration timeout)
returns set of beans found, with retry, empty set if none after timeout


doesMBeanExistsEventually

public java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, groovy.time.TimeDuration timeout)


doesMBeanExistsEventually

public java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, long timeoutMillis)


doesMBeanExistsEventually

public java.util.Set doesMBeanExistsEventually(java.lang.String objectName, Duration timeout)


doesMBeanExistsEventually

public java.util.Set doesMBeanExistsEventually(java.lang.String objectName, groovy.time.TimeDuration timeout)


doesMBeanExistsEventually

public java.util.Set doesMBeanExistsEventually(java.lang.String objectName, long timeout, java.util.concurrent.TimeUnit timeUnit)


doesMBeanExistsEventually

public java.util.Set doesMBeanExistsEventually(javax.management.ObjectName objectName, long timeout, java.util.concurrent.TimeUnit timeUnit)


findMBean

public javax.management.ObjectInstance findMBean(javax.management.ObjectName objectName)


findMBeans

public java.util.Set findMBeans(javax.management.ObjectName objectName)


getAttribute

public java.lang.Object getAttribute(javax.management.ObjectName objectName, java.lang.String attribute)


getConnection

protected javax.management.MBeanServerConnection getConnection()


getConnectionEnvVars

KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
public java.util.Map getConnectionEnvVars()


getProxyObject

public M getProxyObject(java.lang.String objectName, java.lang.Class mbeanInterface)


getProxyObject

public M getProxyObject(javax.management.ObjectName objectName, java.lang.Class mbeanInterface)


getUrl

public java.lang.String getUrl()


isConnected

public boolean isConnected()
Reconnects. If it already is connected, it disconnects first.
throws:
IOException


operation

public java.lang.Object operation(java.lang.String objectName, java.lang.String method, java.lang.Object... arguments)


operation

public java.lang.Object operation(javax.management.ObjectName objectName, java.lang.String method, java.lang.Object... arguments)


reconnect

public void reconnect()


reconnectWithRetryDampened

public void reconnectWithRetryDampened()


removeNotificationListener

public void removeNotificationListener(java.lang.String objectName, javax.management.NotificationListener listener)


removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener)


removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName objectName, javax.management.NotificationListener listener, javax.management.NotificationFilter filter)


setAttribute

public void setAttribute(java.lang.String objectName, java.lang.String attribute, java.lang.Object val)
See Also:
operation(ObjectName, String, Object ...)


setAttribute

public void setAttribute(javax.management.ObjectName objectName, java.lang.String attribute, java.lang.Object val)


setMinTimeBetweenReconnectAttempts

public void setMinTimeBetweenReconnectAttempts(int val)


toConnectorUrl

public static java.lang.String toConnectorUrl(java.lang.String host, java.lang.Integer jmxRmiServerPort, java.lang.Integer rmiRegistryPort, java.lang.String context)
deprecated:
since 0.6.0 use toJmxUrl(EntityLocal)


toConnectorUrl

public static java.lang.String toConnectorUrl(EntityLocal entity)


toJmxUrl

public static java.lang.String toJmxUrl(EntityLocal entity)
constructs a JMX URL suitable for connecting to the given entity, being smart about JMX/RMI vs JMXMP


toJmxmpUrl

public static java.lang.String toJmxmpUrl(java.lang.String host, java.lang.Integer jmxmpPort)
constructs a JMXMP URL for connecting to the given host and port


toLiteralObjectName

public javax.management.ObjectName toLiteralObjectName(javax.management.ObjectName objectName)


toRmiJmxUrl

public static java.lang.String toRmiJmxUrl(java.lang.String host, java.lang.Integer jmxRmiServerPort, java.lang.Integer rmiRegistryPort, java.lang.String context)
constructs an RMI/JMX URL with the given inputs (where the RMI Registry Port should be non-null, and at least one must be non-null)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.