org.apache.servicemix.http.endpoints
Class HttpProviderEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ProviderEndpoint
              extended by org.apache.servicemix.http.endpoints.HttpProviderEndpoint
All Implemented Interfaces:
org.apache.servicemix.common.Endpoint, HttpEndpointType
Direct Known Subclasses:
HttpSoapProviderEndpoint

public class HttpProviderEndpoint
extends org.apache.servicemix.common.endpoints.ProviderEndpoint
implements HttpEndpointType

A plain HTTP provider. This type of endpoint can be used to send non-SOAP requests to HTTP endpoints.

Since:
3.2
Author:
gnodet

Nested Class Summary
protected  class HttpProviderEndpoint.Exchange
           
protected  class HttpProviderEndpoint.SSLManagedHttpClient
           
 
Field Summary
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, logger, service, serviceUnit
 
Constructor Summary
HttpProviderEndpoint()
           
HttpProviderEndpoint(org.apache.servicemix.common.DefaultComponent component, javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
HttpProviderEndpoint(org.apache.servicemix.common.ServiceUnit serviceUnit, QName service, String endpoint)
           
 
Method Summary
 int getClientSoTimeout()
           
protected  org.mortbay.jetty.client.HttpClient getConnectionPool()
           
 String getLocationURI()
          Returns the URI to which the endpoint sends requests.
 HttpProviderMarshaler getMarshaler()
           
 String getProxyHost()
           
 String getProxyPassword()
           
 int getProxyPort()
           
 String getProxyUsername()
           
 SslParameters getSsl()
           
protected  void handle(SmxHttpExchange httpExchange, javax.jbi.messaging.MessageExchange exchange)
           
protected  void handleException(SmxHttpExchange httpExchange, javax.jbi.messaging.MessageExchange exchange, Throwable ex)
           
 void process(javax.jbi.messaging.MessageExchange exchange)
           
 void setClientSoTimeout(int clientTimeout)
          Sets the number of milliseconds the endpoint will block while attempting to read a request.
 void setLocationURI(String locationURI)
          Sets the URI to which an endpoint sends requests.
 void setMarshaler(HttpProviderMarshaler marshaler)
          Sets the class used to marshal messages.
 void setProxyHost(String proxyHost)
          Sets the host name of the HTTP proxy used
 void setProxyPassword(String proxyPassword)
          Sets the password for the HTTP proxy authentication
 void setProxyPort(int proxyPort)
          Sets the host port of the HTTP proxy used (defaults to 80)
 void setProxyUsername(String proxyUsername)
          Sets the user name for the HTTP proxy authentication
 void setSsl(SslParameters ssl)
          Sets the SSL parameters
 void stop()
           
 void validate()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.ProviderEndpoint
activate, deactivate, getRole, processInOnly, processInOut
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync, start
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpProviderEndpoint

public HttpProviderEndpoint()

HttpProviderEndpoint

public HttpProviderEndpoint(org.apache.servicemix.common.DefaultComponent component,
                            javax.jbi.servicedesc.ServiceEndpoint endpoint)

HttpProviderEndpoint

public HttpProviderEndpoint(org.apache.servicemix.common.ServiceUnit serviceUnit,
                            QName service,
                            String endpoint)
Method Detail

getLocationURI

public String getLocationURI()
Returns the URI to which the endpoint sends requests.

Returns:
a string representing the URI to which requests are sent

setLocationURI

public void setLocationURI(String locationURI)
Sets the URI to which an endpoint sends requests.

Parameters:
locationURI - a string representing the URI

getMarshaler

public HttpProviderMarshaler getMarshaler()
Returns:
the marshaler

setMarshaler

public void setMarshaler(HttpProviderMarshaler marshaler)
Sets the class used to marshal messages.

Parameters:
marshaler - the marshaler to set

getProxyHost

public String getProxyHost()

setProxyHost

public void setProxyHost(String proxyHost)
Sets the host name of the HTTP proxy used

Parameters:
proxyHost - the host name of the HTTP proxy

getProxyPort

public int getProxyPort()

setProxyPort

public void setProxyPort(int proxyPort)
Sets the host port of the HTTP proxy used (defaults to 80)

Parameters:
proxyPort - the host name of the HTTP proxy

getProxyUsername

public String getProxyUsername()

setProxyUsername

public void setProxyUsername(String proxyUsername)
Sets the user name for the HTTP proxy authentication

Parameters:
proxyUsername - the user name for the HTTP proxy authentication

getProxyPassword

public String getProxyPassword()

setProxyPassword

public void setProxyPassword(String proxyPassword)
Sets the password for the HTTP proxy authentication

Parameters:
proxyPassword - the password for the HTTP proxy authentication

getSsl

public SslParameters getSsl()

setSsl

public void setSsl(SslParameters ssl)
Sets the SSL parameters

Parameters:
ssl - the SSL parameters

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws Exception
Specified by:
process in interface org.apache.servicemix.common.Endpoint
Overrides:
process in class org.apache.servicemix.common.endpoints.ProviderEndpoint
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface org.apache.servicemix.common.Endpoint
Overrides:
stop in class org.apache.servicemix.common.endpoints.SimpleEndpoint
Throws:
Exception

handle

protected void handle(SmxHttpExchange httpExchange,
                      javax.jbi.messaging.MessageExchange exchange)
               throws IOException
Throws:
IOException

handleException

protected void handleException(SmxHttpExchange httpExchange,
                               javax.jbi.messaging.MessageExchange exchange,
                               Throwable ex)

getConnectionPool

protected org.mortbay.jetty.client.HttpClient getConnectionPool()
                                                         throws Exception
Throws:
Exception

getClientSoTimeout

public int getClientSoTimeout()

setClientSoTimeout

public void setClientSoTimeout(int clientTimeout)
Sets the number of milliseconds the endpoint will block while attempting to read a request. The default value is 60000. Setting this to 0 specifies that the endpoint will never timeout.

Parameters:
clientTimeout - an int specifying the number of milliseconds the socket will block while attempting to read a request

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Specified by:
validate in interface org.apache.servicemix.common.Endpoint
Overrides:
validate in class org.apache.servicemix.common.endpoints.AbstractEndpoint
Throws:
javax.jbi.management.DeploymentException


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.