Search in sources :

Example 1 with PollerFrontEnd

use of org.opennms.netmgt.poller.remote.PollerFrontEnd in project opennms by OpenNMS.

the class Main method getPollerFrontEnd.

private PollerFrontEnd getPollerFrontEnd(final AbstractApplicationContext context) {
    PollerFrontEnd frontEnd = (PollerFrontEnd) context.getBean("pollerFrontEnd");
    frontEnd.addPropertyChangeListener(new ShouldExitPropertyChangeListener(context));
    return frontEnd;
}
Also used : PollerFrontEnd(org.opennms.netmgt.poller.remote.PollerFrontEnd)

Example 2 with PollerFrontEnd

use of org.opennms.netmgt.poller.remote.PollerFrontEnd in project opennms by OpenNMS.

the class Main method run.

@Override
public void run() {
    try {
        // Parse arguments to initialize the configuration fields.
        parseArguments(m_args);
        // Test to make sure that we can use ICMP. If not, replace the ICMP
        // implementation with NullPinger.
        initializePinger();
        // If we didn't get authentication information from the command line or
        // system properties, then use an AWT window to prompt the user.
        // Initialize a Spring {@link SecurityContext} that contains the
        // credentials.
        getAuthenticationInfo();
        AbstractApplicationContext context = createAppContext();
        PollerFrontEnd frontEnd = getPollerFrontEnd(context);
        if (!m_gui && !m_scanReport) {
            if (!frontEnd.isRegistered()) {
                if (m_locationName == null) {
                    LOG.error("No location name provided.  You must pass a location name the first time you start the Remote Poller!");
                    System.exit(27);
                } else {
                    frontEnd.register(m_locationName);
                }
            }
        }
    } catch (Throwable e) {
        // a fatal exception occurred
        LOG.error("Exception occurred during registration!", e);
        System.exit(27);
    }
}
Also used : AbstractApplicationContext(org.springframework.context.support.AbstractApplicationContext) PollerFrontEnd(org.opennms.netmgt.poller.remote.PollerFrontEnd)

Aggregations

PollerFrontEnd (org.opennms.netmgt.poller.remote.PollerFrontEnd)2 AbstractApplicationContext (org.springframework.context.support.AbstractApplicationContext)1