在 Geronimo 中管理 Apache Pluto
2010-03-30 00:00:00 来源:WEB开发网Pluto 门户环境的配置信息将被 org.apache.pluto.portalImpl.services.ServiceManager 类中存储的对象引用并被使用 ServiceManager 类的 getService 方法检索。必须将对 org.apache.pluto.portalImpl.services.config.ConfigService 类的引用作为参数传递给 ServiceManager 类的 getService 方法才能检索 ConfigService 组件的实例。
ConfigService 组件的实例可用后,您可以将此组件打包成一个标准的 Geronimo GBean 并使其可用于 Pluto 管理环境。清单 2 演示了如何由 Geronimo GBean 表示 ConfigService 信息。
清单 2. 作为 Geronimo GBean 的 ConfigService
public class ConfigServiceGBean
implements GBeanLifecycle
{
public static final GBeanInfo GBEAN_INFO;
static
{
GBeanInfoBuilder infoBuilder =
new GBeanInfoBuilder("ConfigServiceGBean", ConfigServiceGBean.class);
infoBuilder.addAttribute("parameters",
org.apache.pluto.portalImpl.util.Parameters.class,
true);
infoBuilder.addOperation("getParameters");
infoBuilder.addOperation("setString", new Class[] { String.class,
String.class });
infoBuilder.addOperation("getString", new Class[] { String.class });
infoBuilder.addOperation("getInteger", new Class[] { String.class });
infoBuilder.addOperation("getBoolean", new Class[] { String.class });
infoBuilder.addOperation("paramKeys");
GBEAN_INFO = infoBuilder.getBeanInfo();
}
public static GBeanInfo getGBeanInfo()
{
return GBEAN_INFO;
}
private org.apache.pluto.portalImpl.services.config.ConfigServiceImpl
configServiceImpl = null;
public ConfigServiceGBean()
{
try
{
Class configServiceCls =
Class.forName("org.apache.pluto.portalImpl.services.config.ConfigService");
org.apache.pluto.portalImpl.services.Service configService =
org.apache.pluto.portalImpl.services.ServiceManager.getService(configServiceCls);
if (configService != null)
{
configServiceImpl =
(org.apache.pluto.portalImpl.services.config.ConfigServiceImpl)
configService;
}
}
catch(Exception e)
{
System.err.println("Exception in ConfigServiceGBean: " + e);
}
}
public org.apache.pluto.portalImpl.util.Parameters getParameters()
{
return configServiceImpl.getParameters();
}
public java.util.Iterator paramKeys()
{
return configServiceImpl.getParameters().keys();
}
public String getString(String name)
{
return configServiceImpl.getString(name);
}
public void setString(String name, String value)
{
configServiceImpl.getParameters().setString(name, value);
}
public Integer getInteger(String name)
{
return configServiceImpl.getInteger(name);
}
public Boolean getBoolean(String name)
{
return configServiceImpl.getBoolean(name);
}
public void doFail()
{
System.err.println(getClass().getName() + " failed");
}
public void doStart()
throws Exception
{
System.out.println("Starting " + getClass().getName());
}
public void doStop()
throws Exception
{
System.out.println("Stopping " + getClass().getName());
}
}
- ››apache设置域名绑定 以及绑定不起作用的排查
- ››apache rewrite将指定URL转向指定的几个服务器
- ››apache配置文件httpd.comf部分参数说明
- ››Apache+Mysql+PHP+phpMyAdmin+Mac OS X 10.7 Lion...
- ››管理/var/spool/clientmqueue/下的大文件
- ››apache+tomcat负载均衡_项目实例
- ››apache mysql php 源码编译使用
- ››Apache添加mod_aspdotnet.so支持ASP.NET配置指南
- ››Apache中改变php.ini的路径
- ››Apache2.2与Tomcat6整合及虚拟主机配置
- ››Apache+php+mysql在windows下的安装与配置图解
- ››Apache+Subversion完美结合,CentOS下实现版本控制...
更多精彩
赞助商链接