Example usage for org.springframework.jmx.support ConnectorServerFactoryBean setServiceUrl

List of usage examples for org.springframework.jmx.support ConnectorServerFactoryBean setServiceUrl

Introduction

In this page you can find the example usage for org.springframework.jmx.support ConnectorServerFactoryBean setServiceUrl.

Prototype

public void setServiceUrl(String serviceUrl) 

Source Link

Document

Set the service URL for the JMXConnectorServer .

Usage

From source file:com.newlandframework.rpc.jmx.ThreadPoolMonitorProvider.java

@Bean
@DependsOn("registry")
public ConnectorServerFactoryBean connectorServer() throws MalformedObjectNameException {
    MessageRecvExecutor ref = MessageRecvExecutor.getInstance();
    String ipAddr = StringUtils.isNotEmpty(ref.getServerAddress())
            ? StringUtils.substringBeforeLast(ref.getServerAddress(), DELIMITER)
            : "localhost";
    url = "service:jmx:rmi://" + ipAddr + "/jndi/rmi://" + ipAddr + ":1099/nettyrpcstatus";
    System.out.println("NettyRPC JMX MonitorURL : [" + url + "]");
    ConnectorServerFactoryBean connectorServerFactoryBean = new ConnectorServerFactoryBean();
    connectorServerFactoryBean.setObjectName("connector:name=rmi");
    connectorServerFactoryBean.setServiceUrl(url);
    return connectorServerFactoryBean;
}