Home | History | Annotate | Download | only in jbosh
      1 /*
      2  * Copyright 2009 Mike Cumings
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *   http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.kenai.jbosh;
     18 
     19 /**
     20  * Interface used by parties interested in monitoring outbound requests made
     21  * by the client to the connection manager (CM).  No opportunity is provided
     22  * to manipulate the outbound request.
     23  * <p/>
     24  * The messages being sent are typically modified copies of the message
     25  * body provided to the {@code BOSHClient} instance, built from the
     26  * originally provided message body plus additional BOSH protocol
     27  * state and information.  Messages may also be sent automatically when the
     28  * protocol requires it, such as maintaining a minimum number of open
     29  * connections to the connection manager.
     30  * <p/>
     31  * Listeners are executed by the sending thread immediately prior to
     32  * message transmission and should not block for any significant amount
     33  * of time.
     34  */
     35 public interface BOSHClientRequestListener {
     36 
     37     /**
     38      * Called when the listener is being notified that a client request is
     39      * about to be sent to the connection manager.
     40      *
     41      * @param event event instance containing the message being sent
     42      */
     43     void requestSent(BOSHMessageEvent event);
     44 
     45 }
     46