com.softwareag.um.io.ServerContextBuilderFactory Class Referenceabstract

This factory allows you to construct ServerContextBuilders and therefore ServerTransportContexts by passing a String URL. More...

Static Public Member Functions

static ServerContextBuilder getBuilder (String url)
 Creates a ServerContextBuilder based on the protocol in the url and sets the host/port (the port is a file path in SHM) as well as any other parameters which are passed in the url query string. More...
 

Detailed Description

This factory allows you to construct ServerContextBuilders and therefore ServerTransportContexts by passing a String URL.

This way you can compile an application which is Transport agnostic and simply change the URL passed to the application to switch from SHM to Sockets etc. A URL is of the form protocol://host:port?Property=value&Property2=value2 The relevant ServerContextBuilder will be constructed based on the protocol and then the properties will be set using reflection. So on a ServerSocketTransportContext there is a method: withWriteBufferSize(int b) that you could set to 150000 using a URL like this:

* String url = "tcp://localhost:8080?WriteBufferSize=150000";
* ServerTransportContext context = ServerContextBuilderFactory.getBuilder(url).build();
*

Please note that the method is "withWriteBufferSize" but you should pass "WriteBufferSize" to the query string

Member Function Documentation

static ServerContextBuilder com.softwareag.um.io.ServerContextBuilderFactory.getBuilder ( String  url)
static

Creates a ServerContextBuilder based on the protocol in the url and sets the host/port (the port is a file path in SHM) as well as any other parameters which are passed in the url query string.

For example you can construct a ServerSocketTransportContext like this: ServerContextBuilderFactory.getBuilder("tcp://locahost:9000").build();

Parameters
urlformatted as protocol://host:port?property1=value
Returns
a ServerContextBuilder which can be used to build a ServerTransportContext and then a Transport using the TransportFactory