View Javadoc

1   package org.codehaus.xfire.transport;
2   
3   import org.codehaus.xfire.MessageContext;
4   import org.codehaus.xfire.exchange.InMessage;
5   
6   public abstract class AbstractChannel
7       implements Channel
8   {
9       private ChannelEndpoint receiver;
10      private Transport transport;
11      private String uri;
12  
13      public String getUri()
14      {
15          return uri;
16      }
17  
18      public void setUri(String uri)
19      {
20          this.uri = uri;
21      }
22  
23      public void setEndpoint(ChannelEndpoint receiver)
24      {
25          this.receiver = receiver; 
26      }
27  
28      public ChannelEndpoint getEndpoint()
29      {
30          return receiver;
31      }
32  
33      public void receive(MessageContext context, InMessage message)
34      {
35          if (message.getChannel() == null)
36              message.setChannel(this);
37          
38          getEndpoint().onReceive(context, message);
39      }
40  
41      public Transport getTransport()
42      {
43          return transport;
44      }
45  
46      public void setTransport(Transport transport)
47      {
48          this.transport = transport;
49      }
50  }