com.gigaspaces.jmx.focalserver
Class JMXConnectionFinder

java.lang.Object
  extended by com.gigaspaces.jmx.focalserver.JMXConnectionFinder
All Implemented Interfaces:
JMXConnectionFinderMBean, LookupDisoveryManagerMBean, java.util.EventListener, javax.management.MBeanRegistration, net.jini.discovery.DiscoveryListener, net.jini.lookup.ServiceDiscoveryListener

public class JMXConnectionFinder
extends java.lang.Object
implements JMXConnectionFinderMBean, net.jini.lookup.ServiceDiscoveryListener, net.jini.discovery.DiscoveryListener, javax.management.MBeanRegistration

An MBean that uses a Jini ServiceDiscoveryManager to locate MBeans for management by an MBeanServer.


Field Summary
static java.lang.String ALL_GROUPS
           
static java.lang.String[] DEFAULT_GROUPS
           
static net.jini.core.discovery.LookupLocator[] DEFAULT_LOCATORS
           
protected  net.jini.discovery.LookupDiscoveryManager ldm
          controls Jini group and locators
static java.lang.String REMOTE_DOMAIN
          reserved jmx key for the original domain of the remote mbean mbeans must not use this key to avoid conflict
 
Constructor Summary
JMXConnectionFinder()
          Instaniate the MBean.
 
Method Summary
 void addGroup(java.lang.String group)
          add a discovery group
 void addLocator(java.lang.String url)
          add a unicast url
 void discarded(net.jini.discovery.DiscoveryEvent event)
          Not really used, just shows that a LookupService nas gone away
 void discovered(net.jini.discovery.DiscoveryEvent event)
          not really used, just shows that a LookupService was found
 java.lang.String[] getGroups()
          list discovery groups
 java.lang.String[] getLocators()
          list of unicast urls
 void postDeregister()
           
 void postRegister(java.lang.Boolean successful)
          start discovery is successfully registers to mbeanserver
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
          receives mbeanserver reference
 void removeGroup(java.lang.String group)
          remove discovery group
 void removeLocator(java.lang.String url)
          remove a unicast url
 void serviceAdded(net.jini.lookup.ServiceDiscoveryEvent event)
          Called by ServiceDiscoveryManager when a new services was discovered
 void serviceChanged(net.jini.lookup.ServiceDiscoveryEvent event)
           
 void serviceRemoved(net.jini.lookup.ServiceDiscoveryEvent event)
           
 void setAllGroups()
          set discovery to ALL_GROUPS
 void setGroups(java.lang.String[] groups)
           
 void setLocators(java.lang.String[] urls)
          sets an array of Jini unicast urls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_GROUPS

public static final java.lang.String ALL_GROUPS
See Also:
Constant Field Values

REMOTE_DOMAIN

public static final java.lang.String REMOTE_DOMAIN
reserved jmx key for the original domain of the remote mbean mbeans must not use this key to avoid conflict

See Also:
Constant Field Values

DEFAULT_GROUPS

public static java.lang.String[] DEFAULT_GROUPS

DEFAULT_LOCATORS

public static net.jini.core.discovery.LookupLocator[] DEFAULT_LOCATORS

ldm

protected net.jini.discovery.LookupDiscoveryManager ldm
controls Jini group and locators

Constructor Detail

JMXConnectionFinder

public JMXConnectionFinder()
                    throws java.io.IOException
Instaniate the MBean. Create and set a security manager so that the ServiceDiscoveryManager will work. Get a reference to the MBeanServer running in this VM

Throws:
java.io.IOException
Method Detail

discovered

public void discovered(net.jini.discovery.DiscoveryEvent event)
not really used, just shows that a LookupService was found

Specified by:
discovered in interface net.jini.discovery.DiscoveryListener

discarded

public void discarded(net.jini.discovery.DiscoveryEvent event)
Not really used, just shows that a LookupService nas gone away

Specified by:
discarded in interface net.jini.discovery.DiscoveryListener

getGroups

public java.lang.String[] getGroups()
Description copied from interface: LookupDisoveryManagerMBean
list discovery groups

Specified by:
getGroups in interface LookupDisoveryManagerMBean
Returns:

addGroup

public void addGroup(java.lang.String group)
              throws java.io.IOException
Description copied from interface: LookupDisoveryManagerMBean
add a discovery group

Specified by:
addGroup in interface LookupDisoveryManagerMBean
Throws:
java.io.IOException

setGroups

public void setGroups(java.lang.String[] groups)
               throws java.io.IOException
Specified by:
setGroups in interface LookupDisoveryManagerMBean
Throws:
java.io.IOException

removeGroup

public void removeGroup(java.lang.String group)
Description copied from interface: LookupDisoveryManagerMBean
remove discovery group

Specified by:
removeGroup in interface LookupDisoveryManagerMBean

setAllGroups

public void setAllGroups()
                  throws java.io.IOException
Description copied from interface: LookupDisoveryManagerMBean
set discovery to ALL_GROUPS

Specified by:
setAllGroups in interface LookupDisoveryManagerMBean
Throws:
java.io.IOException

getLocators

public java.lang.String[] getLocators()
Description copied from interface: LookupDisoveryManagerMBean
list of unicast urls

Specified by:
getLocators in interface LookupDisoveryManagerMBean
Returns:

addLocator

public void addLocator(java.lang.String url)
                throws java.net.MalformedURLException
Description copied from interface: LookupDisoveryManagerMBean
add a unicast url

Specified by:
addLocator in interface LookupDisoveryManagerMBean
Parameters:
url - in the form of jini://:
Throws:
java.net.MalformedURLException

removeLocator

public void removeLocator(java.lang.String url)
                   throws java.net.MalformedURLException
Description copied from interface: LookupDisoveryManagerMBean
remove a unicast url

Specified by:
removeLocator in interface LookupDisoveryManagerMBean
Parameters:
url - in the form of jini://:
Throws:
java.net.MalformedURLException

setLocators

public void setLocators(java.lang.String[] urls)
                 throws java.net.MalformedURLException
Description copied from interface: LookupDisoveryManagerMBean
sets an array of Jini unicast urls

Specified by:
setLocators in interface LookupDisoveryManagerMBean
Parameters:
urls - in the form of jini://:
Throws:
java.net.MalformedURLException

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer mBeanServer,
                                               javax.management.ObjectName objectName)
                                        throws java.lang.Exception
receives mbeanserver reference

Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postRegister

public void postRegister(java.lang.Boolean successful)
start discovery is successfully registers to mbeanserver

Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

serviceAdded

public void serviceAdded(net.jini.lookup.ServiceDiscoveryEvent event)
Called by ServiceDiscoveryManager when a new services was discovered

Specified by:
serviceAdded in interface net.jini.lookup.ServiceDiscoveryListener

serviceRemoved

public void serviceRemoved(net.jini.lookup.ServiceDiscoveryEvent event)
Specified by:
serviceRemoved in interface net.jini.lookup.ServiceDiscoveryListener

serviceChanged

public void serviceChanged(net.jini.lookup.ServiceDiscoveryEvent event)
Specified by:
serviceChanged in interface net.jini.lookup.ServiceDiscoveryListener


Copyright (c) 2007 GigaSpaces Technologies, Inc.
All Rights Reserved.