Search in sources :

Example 1 with PortMapper

use of com.sun.messaging.jmq.jmsserver.service.PortMapper in project openmq by eclipse-ee4j.

the class Globals method getPortMapper.

public static PortMapper getPortMapper() {
    if (portMapper == null) {
        synchronized (lock) {
            if (portMapper == null) {
                portMapper = new PortMapper(getConfigName());
                try {
                    portMapper.configure(getConfig());
                    // Force portmapper to attempt to bind to port
                    portMapper.bind();
                } catch (Exception e) {
                    portMapper = null;
                    Logger logger = getLogger();
                    if (e instanceof PropertyUpdateException) {
                        logger.log(Logger.ERROR, e.getMessage());
                    } else {
                        logger.logStack(Logger.ERROR, e.getMessage(), e);
                    }
                }
            }
        }
    }
    return portMapper;
}
Also used : PropertyUpdateException(com.sun.messaging.jmq.jmsserver.config.PropertyUpdateException) PortMapper(com.sun.messaging.jmq.jmsserver.service.PortMapper) Logger(com.sun.messaging.jmq.util.log.Logger) BrokerShutdownRuntimeException(com.sun.messaging.jmq.jmsserver.util.BrokerShutdownRuntimeException) PropertyUpdateException(com.sun.messaging.jmq.jmsserver.config.PropertyUpdateException) BrokerException(com.sun.messaging.jmq.jmsserver.util.BrokerException)

Aggregations

PropertyUpdateException (com.sun.messaging.jmq.jmsserver.config.PropertyUpdateException)1 PortMapper (com.sun.messaging.jmq.jmsserver.service.PortMapper)1 BrokerException (com.sun.messaging.jmq.jmsserver.util.BrokerException)1 BrokerShutdownRuntimeException (com.sun.messaging.jmq.jmsserver.util.BrokerShutdownRuntimeException)1 Logger (com.sun.messaging.jmq.util.log.Logger)1