public class SocketHandler
extends org.jboss.logmanager.ExtHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
SocketHandler.Protocol
The type of socket
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
| Constructor and Description |
|---|
SocketHandler()
|
SocketHandler(InetAddress address,
int port)
Creates a socket handler.
|
SocketHandler(SocketHandler.Protocol protocol,
InetAddress address,
int port)
Creates a socket handler.
|
SocketHandler(SocketHandler.Protocol protocol,
String hostname,
int port)
Creates a socket handler.
|
SocketHandler(String hostname,
int port)
Creates a socket handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
doPublish(org.jboss.logmanager.ExtLogRecord record) |
void |
flush() |
InetAddress |
getAddress()
Returns the address being used.
|
int |
getPort()
Returns the port being used.
|
SocketHandler.Protocol |
getProtocol()
Returns the protocol being used.
|
void |
setAddress(InetAddress address)
Sets the address to connect to.
|
void |
setHostname(String hostname)
Sets the address to connect to by doing a lookup on the hostname.
|
void |
setPort(int port)
Sets the port to connect to.
|
void |
setProtocol(SocketHandler.Protocol protocol)
Sets the protocol to use.
|
addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setEnabled, setEncoding, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotectgetEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportErrorpublic static final int DEFAULT_PORT
public SocketHandler()
throws UnknownHostException
UnknownHostException - if an error occurs attempting to retrieve the localhostpublic SocketHandler(String hostname, int port) throws UnknownHostException
hostname - the hostname to connect toport - the port to connect toUnknownHostException - if an error occurs resolving the addresspublic SocketHandler(InetAddress address, int port)
address - the address to connect toport - the port to connect topublic SocketHandler(SocketHandler.Protocol protocol, String hostname, int port) throws UnknownHostException
protocol - the protocol to connect withhostname - the hostname to connect toport - the port to connect toUnknownHostException - if an error occurs resolving the hostnamepublic SocketHandler(SocketHandler.Protocol protocol, InetAddress address, int port)
protocol - the protocol to connect withaddress - the address to connect toport - the port to connect toprotected void doPublish(org.jboss.logmanager.ExtLogRecord record)
doPublish in class org.jboss.logmanager.ExtHandlerpublic void flush()
public void close()
throws SecurityException
close in interface Closeableclose in interface AutoCloseableclose in class org.jboss.logmanager.ExtHandlerSecurityExceptionpublic InetAddress getAddress()
public void setAddress(InetAddress address)
address - the addresspublic void setHostname(String hostname) throws UnknownHostException
hostname - the host name used to resolve the addressUnknownHostException - if an error occurs resolving the addresspublic SocketHandler.Protocol getProtocol()
public void setProtocol(SocketHandler.Protocol protocol)
protocol - the protocol to usepublic int getPort()
public void setPort(int port)
port - the portCopyright © 2015 JBoss by Red Hat. All rights reserved.