Package com.sun.enterprise.config.serverbeans

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


            Configs configs = domain.getConfigs();
            checkDuplicate("config", configs.getConfig(), "name");
            Config[] config = configs.getConfig();
            for(int i=0;i<config.length;i++) {
               
                HttpService httpservice = config[i].getHttpService();
                //checkDuplicate("acl",httpservice.getAcl(), "name");
                checkDuplicate("http-listener",httpservice.getHttpListener(), "id");
                //checkDuplicate("mime",httpservice.getMime(), "name");
                checkDuplicate("virtual-server", httpservice.getVirtualServer(), "id");
               
                IiopService iiopservice = config[i].getIiopService();
                checkDuplicate("iiop-listener",iiopservice.getIiopListener(), "id");
                AdminService adminservice = config[i].getAdminService();
                checkDuplicate("jmx-connector",adminservice.getJmxConnector(), "name");
View Full Code Here


        }
        return result;
    }

    private Set getPeerListeners(final VirtualServer vs) throws ConfigException {
        final HttpService hs = (HttpService) vs.parent();
        if (null == hs) { return Collections.EMPTY_SET; }

        final Set result = new HashSet();
        result.addAll(Arrays.asList(hs.getHttpListener()));
        return result;
    }
View Full Code Here

    throws ConfigException {
        ArrayList virtualServerIds = new ArrayList();
       
        //ms1  Server rootElement = ServerBeansFactory.getServerBean(context);
        Config config  = (Config) ConfigBeansFactory.getConfigBeanByXPath(getConfigContext(),ServerXPathHelper.XPATH_CONFIG);
        HttpService httpService = config.getHttpService();
        VirtualServer[] virtualServers = httpService.getVirtualServer();
        for (int j = 0; j < virtualServers.length; j++) {
            VirtualServer aServer   = virtualServers[j];
            String defWebModule     = aServer.getDefaultWebModule();
            if ((defWebModule != null) &&
            (defWebModule.equals(webModuleName))) {
View Full Code Here

        HostAndPort hAndp = null;
        try
        {
//ms1            Server          server  = (Server) super.getBaseConfigBean();
            Config          config  = (Config) super.getConfigBeanByXPath(ServerXPathHelper.XPATH_CONFIG);
            HttpService     https   = config.getHttpService();
           
            HttpListener[] hlArray = https.getHttpListener();
            //check not needed since there should always be atleast 1 httplistener
            //if you don't find one, use first one.
            HttpListener ls = hlArray[0];
            //default is the first one that is enabled.
            for(int i = 0;i<hlArray.length;i++) {
View Full Code Here

            Config config = ServerBeansFactory.getConfigBean(configContext);
            Server serverBean = ServerBeansFactory.getServerBean(configContext);
            // Create Tomcat Engine
            createEngine();

            HttpService httpService = config.getHttpService();
            configureNotSupported(httpService);

            createConnectors(httpService);
            createJKConnector(httpService);
View Full Code Here

     */
    private void enableHttpMonitoring(){

        String vsId;
        int port;
        HttpService httpService;
       
        ServerContext sc = getServerContext();
        ConfigContext cc = sc.getConfigContext();
        MonitoringRegistry mReg = sc.getMonitoringRegistry();
        try {
            httpService = ServerBeansFactory.getHttpServiceBean(cc);
        } catch(ConfigException ce) {
            _logger.log(Level.WARNING,
                        "Unable to find HttpServiceBean in config",
                        ce);
            return;
        }

        // keep-alive
        try {
            mReg.registerPWCKeepAliveStats(
                new PWCKeepAliveStatsImpl(sc.getDefaultDomainName()),
                null);
        } catch (MonitoringRegistrationException mre) {
            String msg = _logger.getResourceBundle().getString(
                                            "web.monitoringRegistrationError");
            msg = MessageFormat.format(msg,
                                       new Object[] { "PWCKeepAliveStats" });
            _logger.log(Level.WARNING, msg, mre);
        }
       
        // file-cache
        try {
            mReg.registerPWCFileCacheStats(
                new PWCFileCacheStatsImpl(sc.getDefaultDomainName()),null);
        } catch (MonitoringRegistrationException mre) {
            String msg = _logger.getResourceBundle().getString(
                                            "web.monitoringRegistrationError");
            msg = MessageFormat.format(msg,
                                       new Object[] { "PWCFileCacheStats" });
            _logger.log(Level.WARNING, msg, mre);
        }

        // pwc-thread-pool
        try {
            mReg.registerPWCThreadPoolStats(
                new PWCThreadPoolStatsImpl(sc.getDefaultDomainName()),
                null);
        } catch (MonitoringRegistrationException mre) {
            String msg = _logger.getResourceBundle().getString(
                                            "web.monitoringRegistrationError");
            msg = MessageFormat.format(msg,
                                       new Object[] { "PWCThreadPoolStats" });
            _logger.log(Level.WARNING, msg, mre);
        }

        // connection-queue
        try {
            mReg.registerPWCConnectionQueueStats(
                new PWCConnectionQueueStatsImpl(sc.getDefaultDomainName()),
                null);
        } catch (MonitoringRegistrationException mre) {
            String msg = _logger.getResourceBundle().getString(
                                            "web.monitoringRegistrationError");
            msg = MessageFormat.format(msg,
                                       new Object[] { "PWCConnectionQueueStats" });
            _logger.log(Level.WARNING, msg, mre);
        }

        com.sun.enterprise.config.serverbeans.VirtualServer[] vs
                                            = httpService.getVirtualServer();

        HttpListener currentListener;
        for(int i = 0; i<vs.length ; i++) {       
            vsId = vs[i].getId();
            if(!vsId.equalsIgnoreCase(VirtualServer.ADMIN_VS)) {
              
                VirtualServer virtualServer =
                        (VirtualServer)getEngines()[0].findChild(vsId);

                if (virtualServer == null){
                    _logger.log(Level.WARNING,
                                "Invalid virtual-server: " + vsId);
                    continue;
                }
                List listeners = StringUtils.parseStringList(
                                            vs[i].getHttpListeners(), ",");
                if(listeners != null) {
                    ListIterator iter = listeners.listIterator();
                    while(iter.hasNext()) {
                      
                        currentListener = httpService.getHttpListenerById
                                                        (iter.next().toString());

      if (currentListener == null)
          continue;
                       
View Full Code Here

        } catch (ConfigException ce) {
            String msg = _localStrMgr.getString("ConfigNotFound", sName);
            throw new LbReaderException(msg,ce);
        }

        HttpService httpSvc = c.getHttpService();
        HttpListener[] lstnrs = httpSvc.getHttpListener();
        for (int i=0; i < lstnrs.length; i++) {
           if (i != 0 ) {
                listenerStr += " "; // space between listener names
           }
          
View Full Code Here

            String msg = _localStrMgr.getString("ConfigNotFound", sName);
            throw new LbReaderException(msg, ce);
        }

        // http-listeners
        HttpService httpSvc = c.getHttpService();
        HttpListener[] lstnrs = httpSvc.getHttpListener();

        for (int i = 0; i < lstnrs.length; i++) {
            String hostName = resolveAddress(lstnrs[i].getAddress(), sName, c);
            if (lstnrs[i].isEnabled() && !(lstnrs[i].getType().equals("external"))) {
                if (lstnrs[i].isSecurityEnabled())
View Full Code Here

    @Inject
    private Configs configs;

    public void execute(AdminCommandContext context) {
        for (Config config : configs.getConfig()) {
            HttpService service = config.getHttpService();
            if(service == null)
                continue;
            boolean done = false;
            try {
                final List<Property> properties = service.getProperty();
                final Iterator<Property> iterator = properties.iterator();
                while (!done && iterator.hasNext()) {
                    final Property property = iterator.next();
                    String name = property.getName();
                    if ("accessLoggingEnabled".equals(name)
View Full Code Here

                ContextXmlParser parser = new ContextXmlParser(defaultContextXml);
                domainCRS = parser.getClearReferencesStatic();
            }

            List<Boolean> csrs = new ArrayList<Boolean>();
            HttpService httpService = serverConfig.getHttpService();
            DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class);
            String vsIDs = params.virtualservers;
            List<String> vsList = StringUtils.parseStringList(vsIDs, " ,");
            if (httpService != null && vsList != null && !vsList.isEmpty()) {
                for (VirtualServer vsBean : httpService.getVirtualServer()) {
                    if (vsList.contains(vsBean.getId())) {
                        Boolean csr = null;
                        Property prop = vsBean.getProperty("contextXmlDefault");
                        if (prop != null) {
                            File contextXml = new File(serverEnvironment.getInstanceRoot(),
View Full Code Here

TOP

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

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.