Package org.jboss.resteasy.util
Class PortProvider
- java.lang.Object
-
- org.jboss.resteasy.util.PortProvider
-
public class PortProvider extends java.lang.Object
Utility class that provides a port number for the Resteasy embedded container.- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DEFAULT_HOST
private static int
DEFAULT_PORT
private static java.lang.String
ENV_VAR_HOSTNAME
private static java.lang.String
ENV_VAR_NAME
private static java.lang.String
PROPERTY_HOSTNAME
private static java.lang.String
PROPERTY_NAME
-
Constructor Summary
Constructors Constructor Description PortProvider()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getHost()
Look up the configured hostname, first checking an environment variable (RESTEASY_HOST), then a system property (org.jboss.resteasy.host), and finally the default hostname (localhost).static int
getPort()
/** Look up the configured port number, first checking an environment variable (RESTEASY_PORT), then a system property (org.jboss.resteasy.port), and finally the default port (8081).
-
-
-
Field Detail
-
DEFAULT_PORT
private static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
ENV_VAR_NAME
private static final java.lang.String ENV_VAR_NAME
- See Also:
- Constant Field Values
-
PROPERTY_NAME
private static final java.lang.String PROPERTY_NAME
- See Also:
- Constant Field Values
-
DEFAULT_HOST
private static final java.lang.String DEFAULT_HOST
- See Also:
- Constant Field Values
-
ENV_VAR_HOSTNAME
private static final java.lang.String ENV_VAR_HOSTNAME
- See Also:
- Constant Field Values
-
PROPERTY_HOSTNAME
private static final java.lang.String PROPERTY_HOSTNAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPort
public static int getPort()
/** Look up the configured port number, first checking an environment variable (RESTEASY_PORT), then a system property (org.jboss.resteasy.port), and finally the default port (8081).- Returns:
- the port number specified in either the environment or system properties
-
getHost
public static java.lang.String getHost()
Look up the configured hostname, first checking an environment variable (RESTEASY_HOST), then a system property (org.jboss.resteasy.host), and finally the default hostname (localhost).- Returns:
- the host specified in either the environment or system properties
-
-