Package org.glassfish.internal.api

Examples of org.glassfish.internal.api.ServerContext


    private WebModule webModule;

    public ResourceInjectorImpl(WebModule webModule) {
        this.webModule = webModule;
        this.desc = webModule.getWebBundleDescriptor();
        ServerContext serverContext = webModule.getServerContext();
        if (serverContext == null) {
            throw new IllegalStateException(
                    _rb.getString(NO_SERVERT_CONTEXT));
        }
        this.injectionMgr = serverContext.getDefaultServices().getService(
            InjectionManager.class);
    }
View Full Code Here


                    // ServerId in the request will match the new server.
       
                    String serverId = String.valueOf(DEFAULT_SERVER_ID);
                    System.setProperty(J2EE_SERVER_ID_PROP, serverId);
   
                    ServerContext ctx = habitat.getByContract(ServerContext.class);
                    String instanceName = ctx.getInstanceName();

                    /**
                     * if the auto recovery is true, always transaction logs will be written irrespective of
                     * disable_distributed_transaction_logging.
                     * if the auto recovery is false, then disable_distributed_transaction_logging will be used
View Full Code Here

        //Events that we can't process now because they require server restart.
        List<UnprocessedChangeEvent> unprocessedEvents = new ArrayList<UnprocessedChangeEvent>();
        _logger.log(Level.FINE, "In JMSConfigListener - received config event");
        Domain domain = Globals.get(Domain.class);
        String jmsProviderPort = null;
        ServerContext serverContext = Globals.get(ServerContext.class);
        Server thisServer = domain.getServerNamed(serverContext.getInstanceName());
        //if(thisServer.isDas() || thisServer.getCluster() == null)
        {
          //  _logger.log(Level.FINE,"JMSConfigListerner server is either das or a stand-alone instance - hence ignoring");
            //return null;
        }
View Full Code Here

            throw new Exception(ce);
        }
    }

    private void setupClusterViewFromRepository() throws Exception {
        ServerContext context = Globals.get(ServerContext.class);
        Domain domain = Globals.get(Domain.class);
        String serverName = context.getInstanceName();
        Server server = domain.getServerNamed(serverName); //context.getConfigBean();
        //String domainurl = context.getServerConfigURL();
        //rep = new AppserverClusterViewFromCacheRepository(domainurl);
        try {
            nodeHost = getNodeHostName(server);
View Full Code Here

        String name = host.getName();
        String hostName = host.getHost();
        // For LOCAL/EMBEDDED Clustered instances and
        // standalone server instances, use
        // their nodeagent's hostname as the jms host name.
        ServerContext serverContext = Globals.get(ServerContext.class);
        Server server = serverContext.getConfigBean();
        if (overridedHostName != null && !overridedHostName.trim().equals("")) {
           hostName = overridedHostName;
        }

        String port = host.getPort();
View Full Code Here

    private synchronized void init(WebModule wm) {
        if (initialized) {
            return;
        }
        ServerContext serverContext = wm.getServerContext();
        if (serverContext == null) {
            String msg = _rb.getString(NO_SERVER_CONTEXT);
            msg = MessageFormat.format(msg, wm.getName());
            throw new IllegalStateException(msg);
        }
        ServiceLocator services = serverContext.getDefaultServices();
        im = services.getService(InvocationManager.class);
        tm = getJavaEETransactionManager(services);
        injectionMgr = services.getService(InjectionManager.class);
        initialized = true;

        securityContext = serverContext.getDefaultServices().getService(AppServSecurityContext.class);
        if (securityContext != null) {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, SECURITY_CONTEXT_OBTAINED, securityContext);
            }
        } else {
View Full Code Here

    private void setAvailabilityProperties() throws ConnectorRuntimeException {
      if(!isClustered()) return;
        try {
            Domain domain = Globals.get(Domain.class);
            ServerContext serverContext = Globals.get(ServerContext.class);
            Server server = domain.getServerNamed(serverContext.getInstanceName());

            JmsService jmsService = server.getConfig().getJmsService();
            AvailabilityService as = server.getConfig().getAvailabilityService();
            boolean useMasterBroker = true;
            if(as != null && as.getJmsAvailability() != null && ! MASTERBROKER.equalsIgnoreCase(as.getJmsAvailability().getConfigStoreType()))
View Full Code Here

        }
    }

    private boolean isDBEnabled(){
        Domain domain = Globals.get(Domain.class);
        ServerContext serverContext = Globals.get(ServerContext.class);
        Server server = domain.getServerNamed(serverContext.getInstanceName());

        AvailabilityService as = server.getConfig().getAvailabilityService();

        JmsService jmsService = server.getConfig().getJmsService();
View Full Code Here

        Clusters clusters = domain.getClusters();
        if (clusters == null) return false;

        List clusterList = clusters.getCluster();

        ServerContext serverctx = Globals.get(ServerContext.class);
        return JmsRaUtil.isClustered(clusterList, serverctx.getInstanceName());
    }
View Full Code Here

        return getDomainName() + SEPARATOR + getClusterName();
    }

    private String getClusterName() {

        ServerContext serverctx = Globals.get(ServerContext.class);
        String instanceName = serverctx.getInstanceName();

        Domain domain = Globals.get(Domain.class);
        Server server = domain.getServerNamed(instanceName);

        return server.getCluster() != null? server.getCluster().getName(): null;
View Full Code Here

TOP

Related Classes of org.glassfish.internal.api.ServerContext

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.