public interface PortAllocator
allocate(String,
String). If the runtime is not configured with a port range, services requiring sockets should use #{link #reserve} to reserve a port.| Modifier and Type | Field and Description |
|---|---|
static int |
NOT_ALLOCATED |
| Modifier and Type | Method and Description |
|---|---|
Port |
allocate(java.lang.String name,
java.lang.String type)
Allocates a port for the given transport.
|
int |
getAllocatedPortNumber(java.lang.String name)
Returns the port number associated with the name.
|
java.util.Set<java.lang.String> |
getPortTypes()
Returns a list of allocated port types.
|
boolean |
isPoolEnabled()
True if the allocator is configured to pool.
|
void |
release(int port)
Releases the given port and makes it available for re-allocation.
|
void |
release(java.lang.String name)
Releases a port for the given transport and makes it available for re-allocation.
|
void |
releaseAll(java.lang.String type)
Releases a port for the given transport and makes it available for re-allocation.
|
Port |
reserve(java.lang.String name,
java.lang.String type,
int port)
Requests a specific port number to be reserved.
|
static final int NOT_ALLOCATED
boolean isPoolEnabled()
Port allocate(java.lang.String name, java.lang.String type) throws org.fabric3.api.host.Fabric3Exception
name - the port name. Used when a transport uses a port per endpointtype - the transport type, e.g. HTTP, HTTPS, FTP, TCPorg.fabric3.api.host.Fabric3Exception - if there was an error allocating a portPort reserve(java.lang.String name, java.lang.String type, int port) throws org.fabric3.api.host.Fabric3Exception
name - the port name. Used when a transport uses a port per endpointtype - the transport type, e.g. HTTP, HTTPS, FTP, TCPport - the requested port numberorg.fabric3.api.host.Fabric3Exception - if there was an error reserving the portint getAllocatedPortNumber(java.lang.String name)
name - the port nameNOT_ALLOCATED if a port has not been allocatedjava.util.Set<java.lang.String> getPortTypes()
void release(int port)
port - the portvoid release(java.lang.String name)
name - the port namevoid releaseAll(java.lang.String type)
type - the transport type