Class Net4jUtil
- Author:
- Eike Stepper
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ITransportConfigcopyTransportConfig(org.eclipse.net4j.util.lifecycle.ILifecycle lifecycle, ITransportConfig source) static IBufferProviderstatic IBufferProvidercreateBufferFactory(short bufferCapacity) static IBufferPoolstatic IBufferPoolcreateBufferPool(short bufferCapacity) static IBufferPoolcreateBufferPool(IBufferProvider factory) static IAcceptorgetAcceptor(org.eclipse.net4j.util.container.IManagedContainer container, String type, String description) static IBufferProvidergetBufferProvider(org.eclipse.net4j.util.container.IManagedContainer container) static IConnectorgetConnector(org.eclipse.net4j.util.container.IManagedContainer container, String description) static IConnectorgetConnector(org.eclipse.net4j.util.container.IManagedContainer container, String type, String description) static IConnectorgetConnector(org.eclipse.net4j.util.container.IManagedContainer container, String type, String description, long timeout) static ExecutorServicegetExecutorService(org.eclipse.net4j.util.container.IManagedContainer container) static IAcceptorgetLocalAcceptor(org.eclipse.net4j.util.container.IManagedContainer container) static IConnectorgetLocalConnector(org.eclipse.net4j.util.container.IManagedContainer container) static intgetPooledBuffers(IBufferPool bufferPool) static StringgetProtocolID(IProtocol<?> protocol) static intgetProtocolVersion(IProtocol<?> protocol) static longgetProvidedBuffers(IBufferProvider bufferProvider) static longgetRetainedBuffers(IBufferProvider bufferProvider) static voidprepareContainer(org.eclipse.net4j.util.container.IManagedContainer container) Deprecated.static ByteBufferprepareForSending(IBuffer buffer) Encodes the Net4j header of an outgoing buffer and returns a view of the complete message.static IBufferwrapBuffer(ByteBuffer message, Runnable release) Wraps one complete encoded Net4j message without copying its payload.
-
Field Details
-
SCHEME_SEPARATOR
- See Also:
-
DEFAULT_BUFFER_CAPACITY
public static final short DEFAULT_BUFFER_CAPACITY- See Also:
-
LOCAL_ACCEPTOR_TYPE
- Since:
- 4.18
- See Also:
-
LOCAL_ACCEPTOR_DESCRIPTION
- Since:
- 4.18
- See Also:
-
-
Method Details
-
getExecutorService
public static ExecutorService getExecutorService(org.eclipse.net4j.util.container.IManagedContainer container) -
getBufferProvider
public static IBufferProvider getBufferProvider(org.eclipse.net4j.util.container.IManagedContainer container) -
getAcceptor
-
getConnector
public static IConnector getConnector(org.eclipse.net4j.util.container.IManagedContainer container, String type, String description, long timeout) - Since:
- 4.0
-
getConnector
public static IConnector getConnector(org.eclipse.net4j.util.container.IManagedContainer container, String type, String description) -
getConnector
public static IConnector getConnector(org.eclipse.net4j.util.container.IManagedContainer container, String description) -
getLocalAcceptor
public static IAcceptor getLocalAcceptor(org.eclipse.net4j.util.container.IManagedContainer container) - Since:
- 4.18
-
getLocalConnector
public static IConnector getLocalConnector(org.eclipse.net4j.util.container.IManagedContainer container) - Since:
- 4.18
-
createBufferFactory
-
createBufferFactory
-
createBufferPool
-
createBufferPool
-
createBufferPool
-
getProvidedBuffers
-
getRetainedBuffers
-
getPooledBuffers
-
copyTransportConfig
public static ITransportConfig copyTransportConfig(org.eclipse.net4j.util.lifecycle.ILifecycle lifecycle, ITransportConfig source) - Since:
- 2.0
-
getProtocolID
-
getProtocolVersion
- Since:
- 4.2
-
prepareForSending
Encodes the Net4j header of an outgoing buffer and returns a view of the complete message.The payload is not copied. The returned view has position zero and a limit equal to the message length. The original buffer's state, position, and limit are unchanged; the header is written through a duplicate view of its backing storage.
The returned view shares storage with the original
IBuffer. The sender must retain ownership of the buffer until asynchronous transmission has completed or definitively failed. While the transport provider is using the returned view, the buffer must not be released, cleared, reused, or otherwise mutated. This method neither transfers ownership nor releases the buffer.- Parameters:
buffer- An outgoing buffer inPUTTINGstate.- Returns:
- A view of the encoded message, including its four-byte header.
- Throws:
IllegalArgumentException- If the buffer has an invalid channel ID, capacity, or payload length.IllegalStateException- If the buffer is not inPUTTINGstate or violates its state invariants.- Since:
- 4.23
-
wrapBuffer
Wraps one complete encoded Net4j message without copying its payload.The input's current position and limit delimit the message. Ownership of the release action transfers to this method when it is invoked. If validation or wrapper construction fails, the action is invoked once before the failure is rethrown.
- Parameters:
message- Storage containing exactly one complete Net4j message between its current position and limit.release- The action that releases the supplied storage; may benullwhen no action is required.- Returns:
- A getting buffer over the original message storage.
- Throws:
IllegalArgumentException- If the message is incomplete, oversized, malformed, or has an invalid channel ID.- Since:
- 4.23
-
prepareContainer
@Deprecated public static void prepareContainer(org.eclipse.net4j.util.container.IManagedContainer container) Deprecated.Containers created viaContainerUtil.createInitializedContainer()orOMPlatform.createManagedContainer()are initialized automatically. Advanced callers configuring a raw container can useOMBundle.prepareContainer(IManagedContainer).
-
ContainerUtil.createInitializedContainer()orOMPlatform.createManagedContainer()are initialized automatically.