我是JBOSS的新手,正在开发一个项目,用于将应用程序从WebSphere 7迁移到JBOSS EAP 6.3,但在实现Spring FactoryBean导入的java文件中获取编译错误" com.ibm.websphere.sca.ServiceManager& #34;这是一类ws.runtime-7.0.0.0.jar。任何人都可以告诉我,我可以在JBOSS中使用什么替代罐子。
我有实现Spring Frameworks FactoryBean接口的类,因此可以在Spring配置中使用它来创建Service对象。它实际上委托给WebSphere ServiceManager来创建服务。 我需要更改此类或找到另一种方法,以便我可以使用JBOSS ServiceManager创建服务对象,下面是WebSphere中使用的类:
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.FactoryBean;
import com.ibm.websphere.sca.ServiceManager;
public class ServiceFactoryBean implements FactoryBean, BeanNameAware {
private String beanName;
private Class<?> clazz;
/**
* Default constructor.
*/
public ServiceFactoryBean() {
super();
}
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String)
*/
public void setBeanName(String beanName) {
this.beanName = beanName;
}
/**
* Sets the Class object for the service that is to be created.
*
* @param clazz the Class of the service being created.
*/
public void setClass(Class<?> clazz) {
this.clazz = clazz;
}
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.FactoryBean#getObject()
*/
public Object getObject() throws Exception {
return ServiceManager.INSTANCE.locateService(this.beanName);
}
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
*/
public Class getObjectType() {
return this.clazz;
}
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.FactoryBean#isSingleton()
*/
public boolean isSingleton() {
return false;
}
}