Update of /cvsroot/mocklib/osgimgr/input/javasrc/biz/xsoftware/api/osgimgr
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5023/input/javasrc/biz/xsoftware/api/osgimgr
Added Files:
Bootstrap.java ConfigService.java GetComponent.java
ServerFactory.java
Log Message:
add osgimgr to mocklib project for now.
--- NEW FILE: ConfigService.java ---
package biz.xsoftware.api.osgimgr;
import javax.management.NotCompliantMBeanException;
import javax.management.ObjectName;
import org.ungoverned.gravity.servicebinder.ConfigurationService;
public interface ConfigService extends ConfigurationService {
public static final String SERVER_LEVEL1 = "Zeus.Level1:name=";
public void start() throws Exception;
public void stop() throws Exception;
//Another route to directly register a bean
public void registerBean(Class beanInterface, ObjectName name, Object realBean) throws NotCompliantMBeanException;
public void unregisterBean(ObjectName beanName);
}
--- NEW FILE: ServerFactory.java ---
package biz.xsoftware.api.osgimgr;
import java.io.IOException;
import java.util.Map;
import javax.management.MBeanServer;
import javax.management.remote.JMXConnectorServerMBean;
import javax.management.remote.JMXServiceURL;
public interface ServerFactory {
public MBeanServer createServer();
public JMXConnectorServerMBean createJMXConnector(JMXServiceURL address, Map<String, ?> environment, MBeanServer server) throws IOException;
}
--- NEW FILE: GetComponent.java ---
package biz.xsoftware.api.osgimgr;
public interface GetComponent {
public ConfigService getConfigService();
}
--- NEW FILE: Bootstrap.java ---
package biz.xsoftware.api.osgimgr;
import java.lang.reflect.Constructor;
public final class Bootstrap {
public static final String CONFIG_NAME = "biz.xsoftware.osgimgr.ConfigServiceImpl";
private Bootstrap() {}
public static ConfigService createConfigService(ServerFactory factory) throws Exception {
Class<? extends ConfigService> theClass = Class.forName(CONFIG_NAME).asSubclass(ConfigService.class);
Constructor con = theClass.getConstructor(ServerFactory.class);
ConfigService svc = (ConfigService)con.newInstance(factory);
return svc;
}
public static GetComponent createGetComponent() throws Exception {
String className = "biz.xsoftware.osgimgr.GetComponentImpl";
Class<? extends GetComponent> theClass = Class.forName(className).asSubclass(GetComponent.class);
GetComponent svc = theClass.newInstance();
return svc;
}
}
|