Package com.sun.enterprise.server

Examples of com.sun.enterprise.server.ServerContext


                        if (iased != null) {
                            commitOption = iased.getCommitOption();     
                        }
                        if (commitOption == null) {
                            try {
                                ServerContext sc =
                                    ApplicationServer.getServerContext();

                                cfg = ServerBeansFactory.getConfigBean
                                    (sc.getConfigContext());
                            catch (ConfigException ex) {
                                _logger.log(Level.WARNING,
                                            "ejb.createContainer_exception", ex);
                            }
View Full Code Here


            if( iased != null) {
                beanCacheDes = iased.getBeanCache();
            }
       
            EjbContainer ejbContainer = null;
            ServerContext sc = ApplicationServer.getServerContext();
            cfg = ServerBeansFactory.getConfigBean(sc.getConfigContext());
            ejbContainer = cfg.getEjbContainer();

            loadProperties(ejbContainer, beanCacheDes);
            //container.setMonitorOn(ejbContainer.isMonitoringEnabled());
        catch (ConfigException ex) {
View Full Code Here

                bundle.getCMPResourceReference();

            String cmpResourceJndiName = cmpResource.getJndiName();

            // Get the timer data source name from the domain.xml
            ServerContext sc = ApplicationServer.getServerContext();
            EjbContainer ejbc = ServerBeansFactory.
                getConfigBean(sc.getConfigContext()).getEjbContainer();
            EjbTimerService ejbt = ejbc.getEjbTimerService();
            // EjbTimerService is an optional element
            String ejbtDatasource = (ejbt != null) ?
                ejbt.getTimerDatasource() : null;
View Full Code Here

     * @return a Map containing mapping from token to config file.
     * @return ConfigException
     */
    private static Map getOtherConfigMap() throws ConfigException {
        Map token2ConfigMap = new LinkedHashMap();
        ServerContext serverContext = ApplicationServer.getServerContext();
        ElementProperty[] elementProps = null;
        if (serverContext != null) {
            ConfigContext configContext = serverContext.getConfigContext();
            if (configContext != null) {
                SecurityService securityService =
                    ServerBeansFactory.getSecurityServiceBean(configContext);
                if (securityService != null) {
                    elementProps = securityService.getElementProperty();
View Full Code Here

     * @param componentName
     */
    private void init(String componentName) {
       
        this.componentName = componentName;
        ServerContext ctx = ApplicationServer.getServerContext();
        thisInstance = ctx.getInstanceName();
        boolean clustered = false;
        this.presetElectedInstance = System.getProperty
        ("org.glassfish.messagegroup."+componentName+".ElectedInstance");
               

        try {
            clustered = ServerHelper.isServerClustered
            (ctx.getConfigContext(), thisInstance);
        }catch (ConfigException ce) {
            this.__logger.log(Level.SEVERE, ce.getMessage(), ce);           
        }
       
        // If the instance is not clustered, do nothing.... Subsystem that use
        // the ServerMessageRuntime does not need to worry about that.
        if (clustered == false) {
            this.active = false;
            return;
        }       
       
        // Add all the cluster instances to a Set.
        String clusterName = null;
        Set servers = new HashSet();
        try {           
                       
            clusterName = ClusterHelper.getClusterForInstance
            (ctx.getConfigContext(), thisInstance).getName();
           
            Server[] serversArray = (Server[]) ServerHelper.getServersInCluster
            (ctx.getConfigContext(), clusterName);      
           
           
            for (Server server: serversArray) {
                servers.add(server.getName());
            }
View Full Code Here

        iased = ed.getIASEjbExtraDescriptors();
        if( iased != null) {
            beanPoolDes = iased.getBeanPool();
        }
        try {
            ServerContext sc = ApplicationServer.getServerContext();
            //ROB: config changes
            //svr = ServerBeansFactory.getServerBean(sc.getConfigContext());
            cfg = ServerBeansFactory.getConfigBean(sc.getConfigContext());
        catch (ConfigException ex) {
            ex.printStackTrace();
        }
     //ROB: config changes
        //ejbContainer = svr.getEjbContainer();
View Full Code Here

    private void initProperties() {

        try {
           
            // Check for property settings from domain.xml
            ServerContext sc = ApplicationServer.getServerContext();
            EjbContainer ejbc = ServerBeansFactory.
                getConfigBean(sc.getConfigContext()).getEjbContainer();
            EjbTimerService ejbt = ejbc.getEjbTimerService();

            if( ejbt != null ) {

                String valString = ejbt.getMinimumDeliveryIntervalInMillis();
                long val = (valString != null) ?
                    Long.parseLong(valString) : -1;
                   
                if( val > 0 ) {
                    minimumDeliveryInterval_ = val;
                }

                valString = ejbt.getMaxRedeliveries();
                val = (valString != null) ? Long.parseLong(valString) : -1;
                // EJB 2.1 specification minimum is 1
                if( val > 0 ) {
                    maxRedeliveries_ = val;
                }

                valString = ejbt.getRedeliveryIntervalInternalInMillis();
                val = (valString != null) ? Long.parseLong(valString) : -1;
                if( val > 0 ) {
                    redeliveryInterval_ = val;
                }

                // If the system property com.sun.ejb.timer.ReadDBBeforeTimeout
                // is defined by the user use that the value of the flag
                // performDBReadBeforeTimeout
                foundSysPropDBReadBeforeTimeout =
                    getDBReadBeforeTimeoutProperty();

                // The default value for ReadDBBeforeTimeout in case of PE
                // is false. For SE/EE the correct default would set when the
                // EJBLifecyleImpl gets created as part of the EE lifecycle module
                setPerformDBReadBeforeTimeout( false );
            }

            // Compose owner id for all timers created with this
            // server instance. 
            InstanceEnvironment server = sc.getInstanceEnvironment();
            String serverName = server.getName();
            ownerIdOfThisServer_ = serverName;

        } catch(Exception e) {
            logger.log(Level.FINE, "Exception converting timer service " +
View Full Code Here

       return objName;
    }
   
    boolean checkMonitoringEnabled() throws ConfigException {
        ServerContext srCtx = ApplicationServer.getServerContext();
        ConfigContext cfgCtx = srCtx.getConfigContext();
        Config instanceCfg = ServerBeansFactory.getConfigBean(cfgCtx);
       
        MonitoringLevel monitoringLevel = MonitoringLevel.OFF;

        if (instanceCfg.getMonitoringService() != null) {
View Full Code Here

        String alertMsg = msgPrefix
                         + localStrings.getString("threadhang.potentialcount",
                                                 potentialCount);
        if (alertRef != null) {
            try {
                ServerContext srCtx = ApplicationServer.getServerContext();
                ConfigContext cfgCtx = srCtx.getConfigContext();
       
                Domain domain = ServerBeansFactory.getDomainBean(cfgCtx);
                Applications apps = domain.getApplications();
                Mbean definedMBean = apps.getMbeanByName(alertRef);
                ObjectName objName =
View Full Code Here

        if( iased != null) {
            beanCacheDes = iased.getBeanCache();
            beanPoolDes = iased.getBeanPool();
        }
        try {
            ServerContext sc = ApplicationServer.getServerContext();
         //ROB: config changes
            //svr = ServerBeansFactory.getServerBean(sc.getConfigContext());
            cfg = ServerBeansFactory.getConfigBean(sc.getConfigContext());
        catch (ConfigException ex) {
            _logger.log(Level.WARNING, "ejb.entitycontainer_exception", ex);
        }
        //ROB: config changes
        //ejbContainer = svr.getEjbContainer();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.server.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.