001    /*
002     * Copyright 2009 Red Hat, Inc.
003     * Red Hat licenses this file to you under the Apache License, version
004     * 2.0 (the "License"); you may not use this file except in compliance
005     * with the License.  You may obtain a copy of the License at
006     *    http://www.apache.org/licenses/LICENSE-2.0
007     * Unless required by applicable law or agreed to in writing, software
008     * distributed under the License is distributed on an "AS IS" BASIS,
009     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
010     * implied.  See the License for the specific language governing
011     * permissions and limitations under the License.
012     */
013    
014    package org.hornetq.spi.core.remoting;
015    
016    import java.util.Map;
017    
018    import org.hornetq.core.security.HornetQPrincipal;
019    import org.hornetq.core.server.HornetQComponent;
020    import org.hornetq.core.server.cluster.ClusterConnection;
021    import org.hornetq.core.server.management.NotificationService;
022    
023    /**
024     * An Acceptor is used by the Remoting Service to allow clients to connect. It should take care of dispatching client requests
025     * to the Remoting Service's Dispatcher.
026     *
027     * @author <a href="ataylor@redhat.com">Andy Taylor</a>
028     * @author <a href="tim.fox@jboss.com">Tim Fox</a>
029     */
030    public interface Acceptor extends HornetQComponent
031    {
032       /**
033        * Pause the acceptor and stop it from receiving client requests.
034        */
035       void pause();
036    
037       /**
038        * @return the cluster connection associated with this Acceptor
039        */
040       ClusterConnection getClusterConnection();
041       
042       Map<String, Object> getConfiguration();
043    
044       /**
045        * Set the notification service for this acceptor to use.
046        *
047        * @param notificationService the notification service
048        */
049       void setNotificationService(NotificationService notificationService);
050    
051       void setDefaultHornetQPrincipal(HornetQPrincipal defaultHornetQPrincipal);
052    
053       boolean isUnsecurable();
054    }