Java Reference
In-Depth Information
{
public String getDomain();
public String getEntryName();
public void setEntryName( String name );
public String[] getGroups();
public void setGroups( String[] groups );
public void enableConnections();
}
After creating the interface, you need to implement it with the JINIServer
MBean class. Recall from the previous sections that the JINIServer class will cre-
ate the Jini service when requested by the JMX agent. Listing 9.3 shows the
JINIServer class. (Starting with this class, you will notice a lot of Jini-related
packages and classes; this discussion goes into detail for many but not all of the
Jini-related issues. If you need to take time to read more about Jini, check the
documents at http://www.javasoft.com.)
Listing 9.3
JINIServer.java
package jmxbook.ch9;
import javax.management.*;
import java.rmi.*;
import java.util.*;
import net.jini.discovery.*;
import net.jini.core.lookup.*;
import net.jini.lookup.*;
import net.jini.lease.*;
import net.jini.core.discovery.*;
import net.jini.lookup.entry.*;
import net.jini.core.entry.*;
B
Import Jini
packages
C
Implement
necessary
interfaces
public class JINIServer implements JINIServerMBean,
MBeanRegistration,
ServiceIDListener
{
private MBeanServer mbs = null;
private JoinManager jm = null;
private ServiceID id = null;
private String domain = null;
private ObjectName name = null;
private String[] groups;
private Name entry = null;
private boolean enabled = false;
public JINIServer()
{
groups = new String[ 1 ];
groups[ 0 ] = "public";
}
 
Search WWH ::




Custom Search