public class MulticastPulseAgent extends Object implements DiscoveryAgent, ServerService, SelfManaging
| Modifier and Type | Field and Description |
|---|---|
static String |
CLIENT |
static String |
EMPTY |
static String |
SERVER |
| Constructor and Description |
|---|
MulticastPulseAgent()
This agent listens for client pulses on a defined multicast channel.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getIP() |
String |
getName() |
int |
getPort() |
static MulticastSocket[] |
getSockets(String multicastAddress,
int port)
Attempts to return at least one socket per valid network interface.
|
void |
init(Properties p) |
static boolean |
isLocalAddress(String host,
boolean wildcardIsLocal)
Is the provided host a local host
|
static boolean |
isLoopback(String host)
Is the provided host a valid loopback address
|
void |
registerService(URI uri) |
void |
reportFailed(URI serviceUri) |
void |
service(InputStream in,
OutputStream out) |
void |
service(Socket socket) |
void |
setDiscoveryListener(DiscoveryListener listener) |
void |
start() |
void |
stop() |
void |
unregisterService(URI uri) |
public static final String SERVER
public static final String CLIENT
public static final String EMPTY
public MulticastPulseAgent()
public void init(Properties p) throws Exception
init in interface org.apache.openejb.spi.ServiceExceptionpublic void setDiscoveryListener(DiscoveryListener listener)
setDiscoveryListener in interface DiscoveryAgentpublic void registerService(URI uri) throws IOException
registerService in interface DiscoveryAgentIOExceptionpublic void unregisterService(URI uri) throws IOException
unregisterService in interface DiscoveryAgentIOExceptionpublic void reportFailed(URI serviceUri) throws IOException
reportFailed in interface DiscoveryAgentIOExceptionpublic void start()
throws ServiceException
start in interface ServerServiceServiceExceptionpublic void stop()
throws ServiceException
stop in interface ServerServiceServiceExceptionpublic void service(InputStream in, OutputStream out) throws ServiceException, IOException
service in interface ServerServiceServiceExceptionIOExceptionpublic void service(Socket socket) throws ServiceException, IOException
service in interface ServerServiceServiceExceptionIOExceptionpublic String getName()
getName in interface ServerServicepublic String getIP()
getIP in interface ServerServicepublic int getPort()
getPort in interface ServerServicepublic static MulticastSocket[] getSockets(String multicastAddress, int port) throws Exception
multicastAddress - A valid multicast addressport - A valid multicast portException - On invalid parameterspublic static boolean isLoopback(String host)
host - Host to testpublic static boolean isLocalAddress(String host, boolean wildcardIsLocal)
host - The host to testwildcardIsLocal - Should 0.0.0.0 or [::] be deemed as localCopyright © 1999-2014 The Apache Software Foundation. All Rights Reserved.