org.apache.openejb.client
Class FailoverConnectionFactory
java.lang.Object
org.apache.openejb.client.FailoverConnectionFactory
- All Implemented Interfaces:
- ConnectionFactory
public class FailoverConnectionFactory
- extends Object
- implements ConnectionFactory
This factory supports the following URI format
failover:[strategy:]urlList
Where strategy and urlList are variables
strategy = the ConnectionStrategy name, such as "sticky", "round-robin",
or "random". This parameter is optional.
urlList = a comma separated list connection URIs. There must be a
ConnectionFactory installed for the associated URI.
Some examples might be:
- failover:ejbd://foo:4201,ejbd://bar:4201
- failover:random:ejbd://foo:4201,ejbd://bar:4201
- failover:round-robin:ejbd://foo:4201,ejbds://bar:4201,multicast://239.255.2.3:6142
The final URI being the most clever in that it will sequentially go
through the list, first attempting a couple hard-coded addresses before
finally resorting to multicast in an attempt to discover a server.
- Version:
- $Rev$ $Date$
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FailoverConnectionFactory
public FailoverConnectionFactory()
getConnection
public Connection getConnection(URI failoverUri)
throws IOException
- Specified by:
getConnection
in interface ConnectionFactory
- Throws:
IOException
main
public static void main(String[] args)
throws IOException
- Throws:
IOException
Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.