Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.Domain


    public static synchronized RestConfig   getRestConfig(ServiceLocator habitat) {
        if (restConfig == null) {
            if (habitat == null) {
                return null;
            }
            Domain domain = Globals.getDefaultBaseServiceLocator().getService(Domain.class);
            if (domain != null) {
                Config config = domain.getConfigNamed("server-config");
                if (config != null) {
                    restConfig = config.getExtensionByType(RestConfig.class);

                }
            }
View Full Code Here


        return features;
    }

    private void generateASM(ServiceLocator habitat) {
        try {
            Domain entity = habitat.getService(Domain.class);
            Dom dom = Dom.unwrap(entity);

            ResourcesGenerator resourcesGenerator = new ASMResourcesGenerator(habitat);
            resourcesGenerator.generateSingle(dom.document.getRoot().model, dom.document);
            resourcesGenerator.endGeneration();
View Full Code Here

            }



            final Servers servers = server.getParent(Servers.class);
            final Domain domain = servers.getParent(Domain.class);
            final Configs configs = domain.getConfigs();

            if (servers.getServer(serverName) != null) { // validate for set, not _register-instance
                // cannot change config ref of a clustered instance
                Cluster cluster = domain.getClusterForInstance(serverName);
                if (cluster != null) { // cluster is not null during create-local-instance --cluster c1 i1
                    if (!cluster.getConfigRef().equals(configRef)) {
                        // During set when trying to change config-ref of a clustered instance,
                        // the value of desired config-ref will be different than the current config-ref.
                        // During _register-instance, (create-local-instance --cluster c1 i1)
View Full Code Here

        String mdbClassName = descriptor_.getEjbClassName();

        ServerEnvironmentImpl env = Globals.get(ServerEnvironmentImpl.class);
        String instanceName = env.getInstanceName();
       
        Domain domain = Globals.get(Domain.class);
        String domainName = domain.getName();
        Cluster cluster = domain.getServerNamed(instanceName).getCluster();

        String clusterName=null;
        if(cluster!=null){
          // this application is deployed in a cluster
          clusterName = cluster.getName();
View Full Code Here

                    if (!isAutomaticRecovery && disable_distributed_transaction_logging) {
                        Configuration.disableFileLogging();
                    } else {

                       // if (dbLoggingResource == null) {
                        Domain domain = habitat.getComponent(Domain.class);
                        Server server = domain.getServerNamed(instanceName);

                        // Check if the server system property is set
                        String logdir = getTXLogDir(server);

                        // if not, check if the cluster system property is set
                        if(logdir == null) {
                            Cluster cluster = server.getCluster();
                            if (cluster != null) {
                                logdir = getTXLogDir(cluster);
                            }
                        }

                        // No system properties are set - get tx log dir from transaction service
                        if(logdir == null) {
                            logdir = txnService.getTxLogDir();
                        }

                        if(logdir == null) {
                            logdir = domain.getLogRoot();
                            if(logdir == null){
                                // logdir = FileUtil.getAbsolutePath(".." + File.separator + "logs");
                                logdir = ".." + File.separator + "logs";
                            }
                        } else if( ! (new File(logdir)).isAbsolute()) {
                            if(_logger.isLoggable(Level.FINE)) {
                                _logger.log(Level.FINE,
                                    "Relative pathname specified for transaction log directory : "
                                    + logdir);
                            }
                            String logroot = domain.getLogRoot();
                            if(logroot != null){
                                logdir = logroot + File.separator + logdir;
                            } else {
                                // logdir = FileUtil.getAbsolutePath(".." + File.separator + "logs"
                                // + File.separator + logdir);
View Full Code Here

                throw new AuthException("'loginErrorPage' "
                        + "must be supplied as a property in the provider-config "
                        + "in the domain.xml file!");
            }
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            Domain domain = habitat.getService(Domain.class);
            NetworkListener adminListener = domain.getServerNamed("server").getConfig().getNetworkConfig().getNetworkListener("admin-listener");
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
           
            final String host = adminListener.getAddress();
            // Save the REST URL we need to authenticate the user.
            this.restURL =  (SecureAdmin.Util.isEnabled(secureAdmin) ? "https://" : "http://") +
View Full Code Here

    protected void startResourceAdapter(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
        try{
        if (this.moduleName_.equals(ConnectorRuntime.DEFAULT_JMS_ADAPTER)) {
            if (connectorRuntime.isServer()) {
                Domain domain = Globals.get(Domain.class);
                ServerContext serverContext = Globals.get(ServerContext.class);
                Server server = domain.getServerNamed(serverContext.getInstanceName());
                JmsService jmsService = server.getConfig().getExtensionByType(JmsService.class);
                initializeLazyListener(jmsService);
            }
    //System.setProperty("imq.jmsra.direct.clustered", "true");
                AccessController.doPrivileged
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().getExtensionByType(JmsService.class);
          if (jmsService.getType().equals(REMOTE)) {
            //If REMOTE, the broker cluster instances already have
            //been configured with the right properties.
            return;
          }

          AvailabilityService as = server.getConfig().getAvailabilityService();
          if (as == null) {
            logFine("Availability Service is null. Not setting AvailabilityProperties.");
            return;
          }

          boolean useMasterBroker = true;
          if(as.getExtensionByType(JmsAvailability.class) != null && ! MASTERBROKER.equalsIgnoreCase(as.getExtensionByType(JmsAvailability.class).getConfigStoreType()))
            useMasterBroker = false;

          //jmsService.getUseMasterBroker() != null ? Boolean.valueOf(jmsService.getUseMasterBroker()) :true;
          boolean isJmsAvailabilityEnabled = this.isJMSAvailabilityOn(as);

          logFine("Setting AvailabilityProperties .. ");
          if (!useMasterBroker || isJmsAvailabilityEnabled) {
            // For conventional cluster of peer brokers and Enhanced Broker Cluster.
            ConnectorDescriptor cd = getDescriptor();
            String clusterName = getMQClusterName();
            ConnectorConfigProperty  envProp1 = new ConnectorConfigProperty (
                        CLUSTERID , clusterName,"Cluster Id",
                        "java.lang.String");
            setProperty(cd, envProp1);

            if(brokerInstanceName == null) {
                brokerInstanceName = getBrokerInstanceName(jmsService);
            }
            ConnectorConfigProperty  envProp2 = new ConnectorConfigProperty (
                        BROKERID , brokerInstanceName,"Broker Id",
                        "java.lang.String");
            setProperty(cd, envProp2);

            //Only if JMS availability is true - Enhanced Broker Cluster only.
            if (isJmsAvailabilityEnabled) {
              //Set HARequired as true - irrespective of whether it is REMOTE or
              //LOCAL
              ConnectorConfigProperty  envProp3 = new ConnectorConfigProperty (
                          HAREQUIRED , "true","HA Required",
                          "java.lang.String");
              setProperty(cd, envProp3);
               /* The broker has a property to control whether
               * it starts in HA mode or not and that's represented on
               * the RA by BrokerEnableHA.
               * On the MQ Client connection side it is HARequired -
               * this does not control the broker, it just is a client
               * side requirement.
               * So for AS EE, if BrokerType is LOCAL or EMBEDDED,
               * and AS HA is enabled for JMS then both these must be
               * set to true. */

              ConnectorConfigProperty  envProp4 = new ConnectorConfigProperty (
                          BROKERENABLEHA , "true",
                          "BrokerEnableHA flag","java.lang.Boolean");
              setProperty(cd, envProp4);

              String nodeHostName = domain.getNodeNamed(server.getNodeRef()).getNodeHost();
              if (nodeHostName != null) {
                ConnectorConfigProperty  envProp5 = new ConnectorConfigProperty (
                            BROKERBINDADDRESS , nodeHostName,
                            "Broker Bind Address","java.lang.String");
                setProperty(cd, envProp5);
View Full Code Here

        return timeout;
    }

    public static String getBrokerInstanceName(JmsService js){
        ServerEnvironmentImpl serverenv = Globals.get(ServerEnvironmentImpl.class);
        Domain domain = Globals.get(Domain.class);
        String asInstance = serverenv.getInstanceName();
        String domainName = null;
        if (isClustered()) {
            Server server = domain.getServerNamed(asInstance);

            domainName = server.getCluster().getName();
            /*ClusterHelper.getClusterForInstance(
                            ApplicationServer.getServerContext().getConfigContext(),
                            asInstance).getName();*/
 
View Full Code Here

            throw (ConnectorRuntimeException)crex.initCause(e);
        }
    }

    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().getExtensionByType(JmsService.class);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.Domain

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.