001    // Copyright 2004, 2005 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.hivemind.internal;
016    
017    import org.apache.hivemind.InterceptorStack;
018    import org.apache.hivemind.Locatable;
019    
020    /**
021     * A contribution to a service extension point that creates an interceptor.
022     * 
023     * @author Howard Lewis Ship
024     */
025    public interface ServiceInterceptorContribution extends Locatable
026    {
027        /**
028         * Returns the name of the service interceptor.  The name is used for ordering the
029         * service interceptor with respect to other interceptors.  The name defaults
030         * to the factoryServiceId if no name is specified.
031         * @return the name of the service interceptor
032         * @since 1.1
033         */
034        public String getName();
035        
036        /**
037         * Returns the id of the factory that creates the interceptor. Interceptor factories are simply
038         * another HiveMind service, one that implements
039         * {@link org.apache.hivemind.ServiceInterceptorFactory}.
040         */
041        public String getFactoryServiceId();
042    
043        /**
044         * Invoked to actually create the interceptor and push it onto the stack.
045         */
046        public void createInterceptor(InterceptorStack stack);
047    
048        /**
049         * Returns a list interceptors service ids as a comma seperated list. The behavior provided by
050         * these interceptors should <em>precede</em> the behavior of this interceptor.
051         * <p>
052         * Each service id is fully qualified. May return null.
053         */
054        public String getPrecedingInterceptorIds();
055    
056        /**
057         * As {@link #getPrecedingInterceptorIds()}, but the indicating interceptors's behavior should
058         * <em>follow</em> this interceptor's.
059         */
060    
061        public String getFollowingInterceptorIds();
062    }