001 /** 002 * 003 * Copyright 2004 Protique Ltd 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 * 017 **/ 018 019 package org.activemq.transport; 020 021 import org.activemq.service.Service; 022 023 import javax.jms.JMSException; 024 import java.net.InetSocketAddress; 025 026 /** 027 * Represents a Server which accepts incoming client connections 028 * in the form of TransportChannels which is used inside the JMS Broker 029 * 030 * @version $Revision: 1.1.1.1 $ 031 */ 032 public interface TransportServerChannel extends Service { 033 034 /** 035 * close the ServerChannel 036 */ 037 public void stop() throws JMSException; 038 039 040 /** 041 * start listeneing for events 042 * 043 * @throws JMSException if an error occurs 044 */ 045 public void start() throws JMSException; 046 047 /** 048 * Registers the listener to be used when new clients connect or 049 * disconnect 050 * 051 * @param listener the listener to be invoked when a client connects 052 * or disconnects 053 */ 054 public void setTransportChannelListener(TransportChannelListener listener); 055 056 /** 057 * Returns the URL to connect to this connector 058 */ 059 String getUrl(); 060 061 /** 062 * An optional method to return the socket address if there is one on which this 063 * channel is listening. An implementation may return null for this operation; its mostly intended 064 * to be used for tooling to be able to access socket address information. 065 * 066 * @return 067 */ 068 InetSocketAddress getSocketAddress(); 069 }