Package org.apache.geronimo.j2ee.j2eeobjectnames

Examples of org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext


        }

        DeploymentContext context = null;
        context = new DeploymentContext(outfile, configID, ConfigurationModuleType.SERVICE, parentID, domain, server, kernel);

        J2eeContext j2eeContext = new J2eeContextImpl(context.getDomain(), context.getServer(), NameFactory.NULL, NameFactory.J2EE_MODULE, configID.toString(), null, null);
        DependencyType[] includes = configType.getIncludeArray();
        addIncludes(context, includes, repository);
        addDependencies(context, configType.getDependencyArray(), repository);
        ClassLoader cl = context.getClassLoader(repository);
        GbeanType[] gbeans = configType.getGbeanArray();
View Full Code Here


    public Object getServiceReference(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
        return serviceReferenceBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlerInfos, serviceRefType, deploymentContext, module, classLoader);
    }

    public String getResourceAdapterContainerId(URI moduleURI, String resourceLink, NamingContext context) throws UnresolvedReferenceException {
        J2eeContext j2eeContext = context.getJ2eeContext();
        ObjectName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, NameFactory.JCA_RESOURCE_ADAPTER, j2eeContext, context, "resource adapter");
        return containerName.getCanonicalName();
    }
View Full Code Here

        ObjectName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, NameFactory.JCA_RESOURCE_ADAPTER, j2eeContext, context, "resource adapter");
        return containerName.getCanonicalName();
    }

    public String getConnectionFactoryContainerId(URI moduleURI, String resourceLink, String type, NamingContext context) throws UnresolvedReferenceException {
        J2eeContext j2eeContext = context.getJ2eeContext();
        ObjectName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, type, j2eeContext, context, "connection factory");
        return containerName.getCanonicalName();
    }
View Full Code Here

        }
        return destination;
    }

    public String getAdminObjectContainerId(URI moduleURI, String resourceLink, NamingContext context) throws DeploymentException {
        J2eeContext j2eeContext = context.getJ2eeContext();
        ObjectName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, NameFactory.JCA_ADMIN_OBJECT, j2eeContext, context, "admin object");
        return containerName.getCanonicalName();
    }
View Full Code Here

        }
    }

    private GBeanData locateEjbInApplication(NamingContext namingContext, boolean isSession, String ejbLink, URI module) throws UnresolvedReferenceException {
        GBeanData gbeanData;
        J2eeContext j2eeContext = namingContext.getJ2eeContext();
        if (isSession) {
            gbeanData = locateComponentInApplication(ejbLink, module, NameFactory.EJB_MODULE, NameFactory.STATELESS_SESSION_BEAN, j2eeContext, "remote ejb", namingContext, false);
            if (gbeanData == null) {
                gbeanData = locateComponentInApplication(ejbLink, module, NameFactory.EJB_MODULE, NameFactory.STATEFUL_SESSION_BEAN, j2eeContext, "remote ejb", namingContext, true);
            }
View Full Code Here

        executeTestBuildModule(action, true);
    }


    private void executeTestBuildModule(InstallAction action, boolean is15) throws Exception {
        J2eeContext j2eeContext = new J2eeContextImpl("test", "bar", "null", "JCAResource", "org/apache/geronimo/j2ee/deployment/test", null, null);
        String resourceAdapterName = "testRA";
        //N.B. short version of getComponentName
        ObjectName connectionTrackerName = NameFactory.getComponentName(null, null, null, null, "ConnectionTracker", ConnectionTrackingCoordinatorGBean.GBEAN_INFO.getJ2eeType(), j2eeContext);
                //new ObjectName("test:J2EEServer=bar,J2EEModule=org/apache/geronimo/j2ee/deployment/test,service=ConnectionTracker");

        Kernel kernel = KernelFactory.newInstance().createKernel("foo");
        try {
            kernel.boot();

            GBeanData store = new GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), MockConfigStore.GBEAN_INFO);
            kernel.loadGBean(store, this.getClass().getClassLoader());
            kernel.startGBean(store.getName());

            GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
            configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
            kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
            kernel.startGBean(configurationManagerName);

            ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultParentId, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, repository, kernel);
            File rarFile = action.getRARFile();

            ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
            ClassLoader cl = new URLClassLoader(new URL[]{rarFile.toURL()}, oldCl);

            Thread.currentThread().setContextClassLoader(cl);

            JarFile rarJarFile = DeploymentUtil.createJarFile(rarFile);
            Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, j2eeContext.getJ2eeModuleName(), action.getSpecDD(), null, null);
            if (module == null) {
                throw new DeploymentException("Was not a connector module");
            }
            assertEquals(j2eeContext.getJ2eeModuleName(), module.getConfigId().toString());

            File tempDir = null;
            try {
                tempDir = DeploymentUtil.createTempDir();
                EARContext earContext = new EARContext(tempDir,
                        module.getConfigId(),
                        module.getType(),
                        module.getParentId(),
                        kernel,
                        j2eeContext.getJ2eeApplicationName(),
                        null,
                        connectionTrackerName,
                        null,
                        null,
                        null, new RefContext(ejbReferenceBuilder,
View Full Code Here

    }

    protected void setUp() throws Exception {
        super.setUp();
        J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "geronimo.server", "testapp", NameFactory.RESOURCE_ADAPTER_MODULE, "testmodule", TARGET_NAME, NameFactory.JMS_RESOURCE);
        kernel = KernelFactory.newInstance().createKernel(j2eeContext.getJ2eeDomainName());
        kernel.boot();

        GBeanData aow = buildGBeanData("name", TARGET_NAME, AdminObjectWrapperGBean.getGBeanInfo());
        selfName = aow.getAbstractName();
        aow.setAttribute("adminObjectInterface", MockAdminObject.class.getName());
View Full Code Here

    public void initContext(EARContext earContext, Module module, ClassLoader cl) {
        // web application do not add anything to the shared context
    }

    public void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
        J2eeContext earJ2eeContext = earContext.getJ2eeContext();
        J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.WEB_MODULE, module.getName());
        WebModule webModule = (WebModule) module;

        WebAppType webApp = (WebAppType) webModule.getSpecDD();
        GerWebAppType jettyWebApp = (GerWebAppType) webModule.getVendorDD();
View Full Code Here

        cmf.setAttribute("transactionSupport", NoTransactions.INSTANCE);
        cmf.setAttribute("pooling", new NoPool());
        cmf.setReferencePatterns("ConnectionTracker", Collections.singleton(ctcName));
        kernel.loadGBean(cmf, cl);

        J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "geronimo", "testapplication", "noModuleType", "testmodule", TARGET_NAME, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
        managedConnectionFactoryName = NameFactory.getComponentName(null, null, null, NameFactory.JCA_RESOURCE, null, null, null, j2eeContext);

        GBeanData mcfw = new GBeanData(managedConnectionFactoryName, ManagedConnectionFactoryWrapper.getGBeanInfo());
        mcfw.setAttribute("managedConnectionFactoryClass", MockManagedConnectionFactory.class.getName());
        mcfw.setAttribute("connectionFactoryInterface", ConnectionFactory.class.getName());
View Full Code Here

    public static void addResourceRefs(EARContext earContext, URI uri, ResourceRefType[] resourceRefs, Map refMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
        if (refMap == null) {
            refMap = Collections.EMPTY_MAP;
        }
        RefContext refContext = earContext.getRefContext();
        J2eeContext j2eeContext = earContext.getJ2eeContext();

        for (int i = 0; i < resourceRefs.length; i++) {
            ResourceRefType resourceRef = resourceRefs[i];
            String name = getStringValue(resourceRef.getResRefName());
            String type = getStringValue(resourceRef.getResType());
View Full Code Here

TOP

Related Classes of org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.