Search in sources :

Example 1 with TssLinkType

use of org.apache.openejb.jee.oejb2.TssLinkType in project tomee by apache.

the class OpenEjb2Conversion method convertToGeronimoOpenejbXml.

/**
     * Actually called from ReadDescriptors as Geronimo needs this info early
     *
     * @param o2 OpenejbJarType
     * @return GeronimoEjbJarType
     */
public static GeronimoEjbJarType convertToGeronimoOpenejbXml(final OpenejbJarType o2) {
    final GeronimoEjbJarType g2 = new GeronimoEjbJarType();
    g2.setEnvironment(o2.getEnvironment());
    g2.setSecurity(o2.getSecurity());
    g2.getService().addAll(o2.getService());
    g2.getMessageDestination().addAll(o2.getMessageDestination());
    g2.getPersistence().addAll(o2.getPersistence());
    for (final org.apache.openejb.jee.oejb2.EnterpriseBean bean : o2.getEnterpriseBeans()) {
        g2.getAbstractNamingEntry().addAll(bean.getAbstractNamingEntry());
        g2.getPersistenceContextRef().addAll(bean.getPersistenceContextRef());
        g2.getPersistenceUnitRef().addAll(bean.getPersistenceUnitRef());
        g2.getEjbLocalRef().addAll(bean.getEjbLocalRef());
        g2.getEjbRef().addAll(bean.getEjbRef());
        g2.getResourceEnvRef().addAll(bean.getResourceEnvRef());
        g2.getResourceRef().addAll(bean.getResourceRef());
        g2.getServiceRef().addAll(bean.getServiceRef());
        if (bean instanceof RpcBean) {
            final RpcBean rpcBean = (RpcBean) bean;
            if (rpcBean.getTssLink() != null) {
                g2.getTssLink().add(new TssLinkType(rpcBean.getEjbName(), rpcBean.getTssLink(), rpcBean.getJndiName()));
            }
        }
        if (bean instanceof SessionBeanType) {
            final SessionBeanType sb = (SessionBeanType) bean;
            final WebServiceBindingType b = new WebServiceBindingType();
            b.setEjbName(sb.getEjbName());
            b.setWebServiceAddress(sb.getWebServiceAddress());
            b.setWebServiceVirtualHost(sb.getWebServiceVirtualHost());
            b.setWebServiceSecurity(sb.getWebServiceSecurity());
            if (b.containsData()) {
                g2.getWebServiceBinding().add(b);
            }
        }
    }
    return g2;
}
Also used : WebServiceBindingType(org.apache.openejb.jee.oejb2.WebServiceBindingType) RpcBean(org.apache.openejb.jee.oejb2.RpcBean) TssLinkType(org.apache.openejb.jee.oejb2.TssLinkType) SessionBeanType(org.apache.openejb.jee.oejb2.SessionBeanType) GeronimoEjbJarType(org.apache.openejb.jee.oejb2.GeronimoEjbJarType)

Aggregations

GeronimoEjbJarType (org.apache.openejb.jee.oejb2.GeronimoEjbJarType)1 RpcBean (org.apache.openejb.jee.oejb2.RpcBean)1 SessionBeanType (org.apache.openejb.jee.oejb2.SessionBeanType)1 TssLinkType (org.apache.openejb.jee.oejb2.TssLinkType)1 WebServiceBindingType (org.apache.openejb.jee.oejb2.WebServiceBindingType)1