Package com.sun.enterprise.admin.util

Examples of com.sun.enterprise.admin.util.HostAndPort


    /** Return HostAndPort for first listener, using proxies for navigation.
     *@return HostAndPort of the first listener with non-null host and port
     */
    private HostAndPort getDefaultHostPortUsingMBeans() throws IOException, MalformedObjectNameException, MBeanException, InstanceNotFoundException, ReflectionException {
        MBeanServerConnection mbsc = getMBeanServerConnection();
        HostAndPort result = null;
       
        Object[] params = new Object[] {Boolean.FALSE};
        String[] signature = new String[]{ "boolean"};
        ObjectName applicationsMBean = new ObjectName(applicationsMBeanName);
        result = (HostAndPort) mbsc.invoke(applicationsMBean, "getHostAndPort", params, signature);
View Full Code Here


            port = new Integer(getPropertyValueFromTemplate(portString, resolver)).intValue();
            if(listenerProxy.getRedirectPort() != null) {
                port = new Integer(getPropertyValueFromTemplate(listenerProxy.getRedirectPort(), resolver)).intValue();
            }
        }
        HostAndPort hostPort = new HostAndPort(serverName, port);       
        return hostPort;
    }
View Full Code Here

            }
        }
        String port = new PropertyResolver(ctx, instanceName).
                resolve(ls.getPort());
        int intPort = Integer.parseInt (port);
        HostAndPort hp = new HostAndPort("localhost", intPort);
        return new ManagedServerInstance(instanceName, hp, false, mAdminContext);
    }
View Full Code Here

        {
            return;
        }
        try
        {
            HostAndPort hp = getHttpListenerHostPort();
            mDelegate = new ManagedServerInstance(ServerManager.ADMINSERVER_ID,
                                                  hp, false);
        }
        catch (ServerInstanceException sie)
        {
View Full Code Here

     * (host by default is localhost).
     */
    private HostAndPort getHttpListenerHostPort()
        throws ServerInstanceException
    {
        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++) {
                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)
        {
            throw new ServerInstanceException(e.getLocalizedMessage());
        }
View Full Code Here

            parentTargetModuleID.setModuleType(type);
            targetModuleIDs[i] = parentTargetModuleID;

            if (status != null) {
                // let's get the host name and port where the application was deployed
                HostAndPort webHost=null;
                try {
                    Object[] params = new Object[]{ moduleID, Boolean.FALSE };
                    String[] signature = new String[]{ "java.lang.String", "boolean"};
                    ObjectName applicationsMBean = new ObjectName(APPS_CONFIGMBEAN_OBJNAME);               
                    webHost = (HostAndPort) mbsc.invoke(applicationsMBean, "getHostAndPort", params, signature);                       
View Full Code Here

    public ServerInstance(String SOM_name, String serv_name) {
        this(SOM_name,serv_name,-1);
    }
   
    public static HostAndPort configurInstance(String host_name, int port_no){
       HostAndPort hp = new HostAndPort(host_name, port_no);
       return hp;
    }
View Full Code Here

    private  synchronized AppServerInstance getSelectedInstance() throws DeploymentException,AFTargetNotFoundException {
      if(instance == null){
        Reporter.info("Initializing instance");//NOI18N
        String host = this.getName().substring(this.getName().indexOf("(")+1, this.getName().indexOf(":"));//NOI18N
        int port = Integer.parseInt( this.getName().substring(this.getName().indexOf(":")+1, this.getName().indexOf(")")) );//NOI18N
        HostAndPort hostPort = new HostAndPort(host, port);
        Reporter.info("getSelectedInstance " + this.getName().substring(0, this.getName().indexOf("(")));//NOI18N
        Reporter.info(hostPort);
            manager = ServerInstanceManagerFactory.getFactory().getServerInstanceManager(hostPort,userName,password);
            Reporter.assertIt(manager);
            instance = manager.getServerInstance(this.getName().substring(0, this.getName().indexOf("(")));//NOI18N
View Full Code Here

        return getHostAndPort(false);
    }
       
    public HostAndPort getHostAndPort(boolean securityEnabled) throws ServerInstanceException
    {
        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++) {
                if(hlArray[i].isEnabled() && (hlArray[i].isSecurityEnabled()==securityEnabled)) {
                    ls = hlArray[i];
                    break;
                }
            }

            String          port    = ls.getPort();
            int             intPort = Integer.parseInt (port);
            hAndp = new HostAndPort(ls.getServerName(), intPort);
        }
        catch (Exception e)
        {
            throw new ServerInstanceException(e.getLocalizedMessage());
        }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.util.HostAndPort

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.