Java Code Examples for org.apache.axis2.engine.ListenerManager#init()

The following examples show how to use org.apache.axis2.engine.ListenerManager#init() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SampleAxis2Server.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    //To set the socket can be bound even though a previous connection is still in a timeout state.
    if (System.getProperty(CoreConnectionPNames.SO_REUSEADDR) == null) {
        System.setProperty(CoreConnectionPNames.SO_REUSEADDR, "true");
    }
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {

    }
    started = true;
}
 
Example 2
Source File: SampleAxis2Server.java    From product-ei with Apache License 2.0 6 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    //To set the socket can be bound even though a previous connection is still in a timeout state.
    if (System.getProperty(CoreConnectionPNames.SO_REUSEADDR) == null) {
        System.setProperty(CoreConnectionPNames.SO_REUSEADDR, "true");
    }
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {

    }
    started = true;
}
 
Example 3
Source File: Axis2ServerManager.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {
    }
    started = true;
}
 
Example 4
Source File: Axis2ServerManager.java    From product-ei with Apache License 2.0 5 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {
    }
    started = true;
}
 
Example 5
Source File: SampleAxis2ServerManager.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Need to initialize the cluster manager at last since we are changing the servers
        // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
        // to "true"
        ClusteringAgent clusteringAgent =
                configctx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent != null) {
            clusteringAgent.setConfigurationContext(configctx);
            clusteringAgent.init();
        }

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}
 
Example 6
Source File: SampleAxis2ServerManager.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Need to initialize the cluster manager at last since we are changing the servers
        // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
        // to "true"
        ClusteringAgent clusteringAgent =
                configctx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent != null) {
            clusteringAgent.setConfigurationContext(configctx);
            clusteringAgent.init();
        }

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}
 
Example 7
Source File: SampleAxis2ServerManager.java    From product-ei with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Need to initialize the cluster manager at last since we are changing the servers
        // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
        // to "true"
        ClusteringAgent clusteringAgent =
                configctx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent != null) {
            clusteringAgent.setConfigurationContext(configctx);
            clusteringAgent.init();
        }

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}
 
Example 8
Source File: SampleAxis2ServerManager.java    From product-ei with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}