Examples of HttpListener


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

        getVirtualServer(vsID).setHttpListeners(setToStr(httpListeners));
    }

    protected HttpListener getHttpListener(String id) throws ConfigException
    {
        HttpListener listener = config.getHttpService().getHttpListenerById(id);
        checkArg(listener, strMgr.getString("http_listener_vs_assoc_mgr.no_such_element", id));
        return listener;
    }
View Full Code Here

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

    public static String getAdminPort() {
        String sn = ApplicationServer.getServerContext().getInstanceName();
        ConfigContext cc = ApplicationServer.getServerContext()
        .getConfigContext();
        HttpListener admin = null;

        try {
            admin = ServerHelper.getHttpListener(cc, sn,
                    ServerHelper.ADMIN_HTTP_LISTNER_ID);
        } catch (ConfigException ex) {
            ex.printStackTrace();
        }

        String port = null;

        if (admin != null) {
            port = admin.getPort();
        }

        return port;
    }
View Full Code Here

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

    }

    public static String getAdminInet() {
        String sn = ApplicationServer.getServerContext().getInstanceName();
        ConfigContext cc = ApplicationServer.getServerContext().getConfigContext();
        HttpListener admin = null;

        try {
            admin = ServerHelper.getHttpListener(cc, sn,
                    ServerHelper.ADMIN_HTTP_LISTNER_ID);
        } catch (ConfigException ex) {
            ex.printStackTrace();
        }

        String address = null;

        if (admin != null) {
            address = admin.getAddress();
        }

        return address;
    }
View Full Code Here

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

                (getDomainRoot().getCanonicalPath()) + File.separator +
                "config" + File.separator + "domain.xml";
           File domainXML=new File(domainXMLLocation);
           ConfigContext configContext=ConfigFactory.createConfigContext(
                                domainXML.getAbsolutePath());
           HttpListener as=ServerHelper.getHttpListener(configContext,
                                "server", ServerHelper.ADMIN_HTTP_LISTNER_ID);
           String host="localhost";
           int port=Integer.parseInt(as.getPort());
           final LoginInfoStore store = LoginInfoStoreFactory.getStore(null);
           if (store.exists(host, port)) {
               LoginInfo login = store.read(host, port);
               adminPassword = login.getPassword();
               adminUser = login.getUser();
View Full Code Here

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

        try {
            final File xmlFile = efl.getDomainConfigFile();
            if (xmlFile.exists()) {
                final ConfigContext cc  = ConfigFactory.createConfigContext(xmlFile.getAbsolutePath());
                        //get port from HttpListener in domain.xml
                final HttpListener admin = ServerHelper.getHttpListener(cc,
                                                    SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME,
                                                    ServerHelper.ADMIN_HTTP_LISTNER_ID);
                if (admin != null) {
                    final String port = admin.getPort();
                        //set port and host options so that password can be retrieved from .asadminpass
                   
                    setOption("port", port);
                }
            }
View Full Code Here

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

            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++) {
                if(hlArray[i].isEnabled()) {
                    ls = hlArray[i];
                    break;
                }
            }
           
            String          port    = ls.getPort();
            int             intPort = Integer.parseInt (port);
            hAndp = new HostAndPort("localhost", intPort);
        }
        catch (Exception e)
        {
View Full Code Here

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

           
            if ( config == null) return;
           
            ConfigAdd configAdd = null;
            ArrayList configChangeList = event.getConfigChangeList();
            HttpListener httpBean = null;
            String xpath = null;
            Object object;
            Object configObject;
           
            for (int i=0; i < configChangeList.size(); i++){
View Full Code Here

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

            if ( config == null) return;
           
            ConfigChange configChange = null;
            ArrayList<ConfigChange> configChangeList =
                event.getConfigChangeList();
            HttpListener httpBean = null;
            String xpath = null;
            String parentXpath = null;
            Object object;
            ElementProperty elementProperty = null;
View Full Code Here

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

        }

        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;
                       
                        enableHttpListenerMonitoring(virtualServer,
                                Integer.parseInt(currentListener.getPort()),
                                currentListener.getId());
                    }
                }
            }
        }
    }
View Full Code Here

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

     * @param httpService the configuration bean.
     */
    public void deleteConnector(HttpService httpService)
                                                    throws LifecycleException{
        HttpListener[] httpListeners = httpService.getHttpListener();
        HttpListener httpListener;
        Connector[] connectors = (Connector[])_embedded.findConnectors().clone();
                  
        for (int i=0; i < connectors.length; i++){       
            for (int j = 0; j < httpListeners.length; j++) {
                httpListener = (HttpListener)httpListeners[j];           
                if ( ((PECoyoteConnector)connectors[i]).getPort()
                                  == Integer.parseInt(httpListener.getPort())){
                    connectors[i] = null;
                    break;
                }
            }           
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.