Search in sources :

Example 66 with ComponentInvocation

use of org.glassfish.api.invocation.ComponentInvocation in project Payara by payara.

the class ConfigProviderResolverImpl method getDefaultSources.

List<ConfigSource> getDefaultSources() {
    LinkedList<ConfigSource> sources = new LinkedList<>();
    String appName = null;
    String moduleName = null;
    ComponentInvocation currentInvocation = invocationManager.getCurrentInvocation();
    if (currentInvocation == null) {
        ApplicationInfo info = getAppInfo(Thread.currentThread().getContextClassLoader());
        if (info != null) {
            appName = info.getName();
            moduleName = appName;
        }
    } else {
        appName = currentInvocation.getAppName();
        moduleName = currentInvocation.getModuleName();
    }
    String serverName = context.getInstanceName();
    String configName = context.getConfigBean().getConfig().getName();
    sources.add(new DomainConfigSource());
    sources.add(new ClusterConfigSource());
    sources.add(new ConfigConfigSource(configName));
    sources.add(new ServerConfigSource(serverName));
    sources.add(new EnvironmentConfigSource());
    sources.add(new SystemPropertyConfigSource());
    sources.add(new JNDIConfigSource());
    sources.add(new PayaraServerProperties());
    sources.add(new SecretsDirConfigSource());
    if (appName != null) {
        sources.add(new ApplicationConfigSource(appName));
        sources.add(new ModuleConfigSource(appName, moduleName));
        for (Properties props : getDeployedApplicationProperties(appName)) {
            sources.add(new PropertiesConfigSource(props, appName));
        }
    }
    return sources;
}
Also used : PropertiesConfigSource(fish.payara.nucleus.microprofile.config.source.PropertiesConfigSource) ComponentInvocation(org.glassfish.api.invocation.ComponentInvocation) ApplicationInfo(org.glassfish.internal.data.ApplicationInfo) ClusterConfigSource(fish.payara.nucleus.microprofile.config.source.ClusterConfigSource) EnvironmentConfigSource(fish.payara.nucleus.microprofile.config.source.EnvironmentConfigSource) PayaraServerProperties(fish.payara.nucleus.microprofile.config.source.PayaraServerProperties) PayaraServerProperties(fish.payara.nucleus.microprofile.config.source.PayaraServerProperties) Properties(java.util.Properties) LinkedList(java.util.LinkedList) ServerConfigSource(fish.payara.nucleus.microprofile.config.source.ServerConfigSource) SystemPropertyConfigSource(fish.payara.nucleus.microprofile.config.source.SystemPropertyConfigSource) ServerConfigSource(fish.payara.nucleus.microprofile.config.source.ServerConfigSource) ConfigSource(org.eclipse.microprofile.config.spi.ConfigSource) ModuleConfigSource(fish.payara.nucleus.microprofile.config.source.ModuleConfigSource) ConfigConfigSource(fish.payara.nucleus.microprofile.config.source.ConfigConfigSource) EnvironmentConfigSource(fish.payara.nucleus.microprofile.config.source.EnvironmentConfigSource) SecretsDirConfigSource(fish.payara.nucleus.microprofile.config.source.SecretsDirConfigSource) ApplicationConfigSource(fish.payara.nucleus.microprofile.config.source.ApplicationConfigSource) ClusterConfigSource(fish.payara.nucleus.microprofile.config.source.ClusterConfigSource) JNDIConfigSource(fish.payara.nucleus.microprofile.config.source.JNDIConfigSource) PropertiesConfigSource(fish.payara.nucleus.microprofile.config.source.PropertiesConfigSource) DomainConfigSource(fish.payara.nucleus.microprofile.config.source.DomainConfigSource) ModuleConfigSource(fish.payara.nucleus.microprofile.config.source.ModuleConfigSource) ConfigConfigSource(fish.payara.nucleus.microprofile.config.source.ConfigConfigSource) DomainConfigSource(fish.payara.nucleus.microprofile.config.source.DomainConfigSource) SystemPropertyConfigSource(fish.payara.nucleus.microprofile.config.source.SystemPropertyConfigSource) SecretsDirConfigSource(fish.payara.nucleus.microprofile.config.source.SecretsDirConfigSource) ApplicationConfigSource(fish.payara.nucleus.microprofile.config.source.ApplicationConfigSource) JNDIConfigSource(fish.payara.nucleus.microprofile.config.source.JNDIConfigSource)

Example 67 with ComponentInvocation

use of org.glassfish.api.invocation.ComponentInvocation in project Payara by payara.

the class WSTCPAdapterRegistryImpl method createWSAdapter.

private TCPAdapter createWSAdapter(@NotNull final String wsPath, @NotNull final WSEndpointDescriptor wsEndpointDescriptor) throws Exception {
    if (wsEndpointDescriptor.isEJB()) {
        final EjbRuntimeEndpointInfo ejbEndPtInfo = (EjbRuntimeEndpointInfo) V3Module.getWSEjbEndpointRegistry().getEjbWebServiceEndpoint(wsEndpointDescriptor.getURI(), "POST", null);
        final AdapterInvocationInfo adapterInfo = (AdapterInvocationInfo) ejbEndPtInfo.prepareInvocation(true);
        return new Ejb109Adapter(wsEndpointDescriptor.getWSServiceName().toString(), wsPath, adapterInfo.getAdapter().getEndpoint(), new ServletFakeArtifactSet(wsEndpointDescriptor.getRequestURL(), wsEndpointDescriptor.getUrlPattern()), ejbEndPtInfo, adapterInfo);
    } else {
        final String uri = wsEndpointDescriptor.getURI();
        final Adapter adapter = JAXWSAdapterRegistry.getInstance().getAdapter(wsEndpointDescriptor.getContextRoot(), uri, uri);
        final WebModule webModule = AppServRegistry.getWebModule(wsEndpointDescriptor.getWSServiceEndpoint());
        final ComponentInvocation invocation = new WebComponentInvocation(webModule);
        return new Web109Adapter(wsEndpointDescriptor.getWSServiceName().toString(), wsPath, adapter.getEndpoint(), new ServletFakeArtifactSet(wsEndpointDescriptor.getRequestURL(), wsEndpointDescriptor.getUrlPattern()), invocation);
    }
}
Also used : WebComponentInvocation(com.sun.enterprise.web.WebComponentInvocation) EjbRuntimeEndpointInfo(org.glassfish.webservices.EjbRuntimeEndpointInfo) WebComponentInvocation(com.sun.enterprise.web.WebComponentInvocation) ComponentInvocation(org.glassfish.api.invocation.ComponentInvocation) AdapterInvocationInfo(org.glassfish.webservices.AdapterInvocationInfo) TCPAdapter(com.sun.xml.ws.transport.tcp.server.TCPAdapter) Adapter(com.sun.xml.ws.api.server.Adapter) WebModule(com.sun.enterprise.web.WebModule)

Aggregations

ComponentInvocation (org.glassfish.api.invocation.ComponentInvocation)67 InvocationManager (org.glassfish.api.invocation.InvocationManager)13 JndiNameEnvironment (com.sun.enterprise.deployment.JndiNameEnvironment)8 EjbInvocation (com.sun.ejb.EjbInvocation)7 InvocationException (org.glassfish.api.invocation.InvocationException)7 SecurityContext (com.sun.enterprise.security.SecurityContext)6 WebModule (com.sun.enterprise.web.WebModule)6 PoolingException (com.sun.appserv.connectors.internal.api.PoolingException)5 InjectionException (com.sun.enterprise.container.common.spi.util.InjectionException)5 WebComponentInvocation (com.sun.enterprise.web.WebComponentInvocation)5 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)4 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)4 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)4 JavaEETransactionManager (com.sun.enterprise.transaction.api.JavaEETransactionManager)4 RemoteException (java.rmi.RemoteException)4 EJBInvocation (org.glassfish.ejb.api.EJBInvocation)4 ArrayList (java.util.ArrayList)3 NamingException (javax.naming.NamingException)3 WeldBootstrap (org.jboss.weld.bootstrap.WeldBootstrap)3 BeanDeploymentArchive (org.jboss.weld.bootstrap.spi.BeanDeploymentArchive)3