1 18 package org.apache.activemq.broker.jmx; 19 20 import org.apache.activemq.broker.Broker; 21 import org.apache.activemq.broker.Connection; 22 import org.apache.activemq.broker.TransportConnector; 23 import org.apache.activemq.transport.Transport; 24 import org.apache.activemq.transport.TransportServer; 25 26 import javax.management.MBeanServer ; 27 import javax.management.ObjectName ; 28 29 import java.io.IOException ; 30 import java.net.URISyntaxException ; 31 32 38 public class ManagedTransportConnector extends TransportConnector { 39 40 static long nextConnectionId = 1; 41 42 private final MBeanServer mbeanServer; 43 private final ObjectName connectorName; 44 45 public ManagedTransportConnector(MBeanServer mbeanServer, ObjectName connectorName, Broker next, TransportServer server) { 46 super(next, server); 47 this.mbeanServer = mbeanServer; 48 this.connectorName = connectorName; 49 } 50 51 public ManagedTransportConnector asManagedConnector(MBeanServer mbeanServer, ObjectName connectorName) throws IOException , URISyntaxException { 52 return this; 53 } 54 55 protected Connection createConnection(Transport transport) throws IOException { 56 return new ManagedTransportConnection(this, transport, getBroker(), isDisableAsyncDispatch() ? null : getTaskRunnerFactory(), mbeanServer, connectorName); 57 } 58 59 protected static synchronized long getNextConnectionId() { 60 return nextConnectionId++; 61 } 62 63 } 64 | Popular Tags |