Package org.apache.guacamole.net
Class DelegatingGuacamoleTunnel
- java.lang.Object
-
- org.apache.guacamole.net.DelegatingGuacamoleTunnel
-
- All Implemented Interfaces:
GuacamoleTunnel
public class DelegatingGuacamoleTunnel extends Object implements GuacamoleTunnel
GuacamoleTunnel implementation which simply delegates all function calls to an underlying GuacamoleTunnel.
-
-
Field Summary
-
Fields inherited from interface org.apache.guacamole.net.GuacamoleTunnel
INTERNAL_DATA_OPCODE
-
-
Constructor Summary
Constructors Constructor Description DelegatingGuacamoleTunnel(GuacamoleTunnel tunnel)
Wraps the given tunnel such that all function calls against this tunnel will be delegated to it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GuacamoleReader
acquireReader()
Acquires exclusive read access to the Guacamole instruction stream and returns a GuacamoleReader for reading from that stream.GuacamoleWriter
acquireWriter()
Acquires exclusive write access to the Guacamole instruction stream and returns a GuacamoleWriter for writing to that stream.void
close()
Release all resources allocated to this GuacamoleTunnel.GuacamoleSocket
getSocket()
Returns the GuacamoleSocket used by this GuacamoleTunnel for reading and writing.UUID
getUUID()
Returns the unique identifier associated with this GuacamoleTunnel.boolean
hasQueuedReaderThreads()
Returns whether there are threads waiting for read access to the Guacamole instruction stream.boolean
hasQueuedWriterThreads()
Returns whether there are threads waiting for write access to the Guacamole instruction stream.boolean
isOpen()
Returns whether this GuacamoleTunnel is open, or has been closed.void
releaseReader()
Relinquishes exclusive read access to the Guacamole instruction stream.void
releaseWriter()
Relinquishes exclusive write access to the Guacamole instruction stream.
-
-
-
Constructor Detail
-
DelegatingGuacamoleTunnel
public DelegatingGuacamoleTunnel(GuacamoleTunnel tunnel)
Wraps the given tunnel such that all function calls against this tunnel will be delegated to it.- Parameters:
tunnel
- The GuacamoleTunnel to wrap.
-
-
Method Detail
-
acquireReader
public GuacamoleReader acquireReader()
Description copied from interface:GuacamoleTunnel
Acquires exclusive read access to the Guacamole instruction stream and returns a GuacamoleReader for reading from that stream.- Specified by:
acquireReader
in interfaceGuacamoleTunnel
- Returns:
- A GuacamoleReader for reading from the Guacamole instruction stream.
-
releaseReader
public void releaseReader()
Description copied from interface:GuacamoleTunnel
Relinquishes exclusive read access to the Guacamole instruction stream. This function should be called whenever a thread finishes using a GuacamoleTunnel's GuacamoleReader.- Specified by:
releaseReader
in interfaceGuacamoleTunnel
-
hasQueuedReaderThreads
public boolean hasQueuedReaderThreads()
Description copied from interface:GuacamoleTunnel
Returns whether there are threads waiting for read access to the Guacamole instruction stream.- Specified by:
hasQueuedReaderThreads
in interfaceGuacamoleTunnel
- Returns:
- true if threads are waiting for read access the Guacamole instruction stream, false otherwise.
-
acquireWriter
public GuacamoleWriter acquireWriter()
Description copied from interface:GuacamoleTunnel
Acquires exclusive write access to the Guacamole instruction stream and returns a GuacamoleWriter for writing to that stream.- Specified by:
acquireWriter
in interfaceGuacamoleTunnel
- Returns:
- A GuacamoleWriter for writing to the Guacamole instruction stream.
-
releaseWriter
public void releaseWriter()
Description copied from interface:GuacamoleTunnel
Relinquishes exclusive write access to the Guacamole instruction stream. This function should be called whenever a thread finishes using a GuacamoleTunnel's GuacamoleWriter.- Specified by:
releaseWriter
in interfaceGuacamoleTunnel
-
hasQueuedWriterThreads
public boolean hasQueuedWriterThreads()
Description copied from interface:GuacamoleTunnel
Returns whether there are threads waiting for write access to the Guacamole instruction stream.- Specified by:
hasQueuedWriterThreads
in interfaceGuacamoleTunnel
- Returns:
- true if threads are waiting for write access the Guacamole instruction stream, false otherwise.
-
getUUID
public UUID getUUID()
Description copied from interface:GuacamoleTunnel
Returns the unique identifier associated with this GuacamoleTunnel.- Specified by:
getUUID
in interfaceGuacamoleTunnel
- Returns:
- The unique identifier associated with this GuacamoleTunnel.
-
getSocket
public GuacamoleSocket getSocket()
Description copied from interface:GuacamoleTunnel
Returns the GuacamoleSocket used by this GuacamoleTunnel for reading and writing.- Specified by:
getSocket
in interfaceGuacamoleTunnel
- Returns:
- The GuacamoleSocket used by this GuacamoleTunnel.
-
close
public void close() throws GuacamoleException
Description copied from interface:GuacamoleTunnel
Release all resources allocated to this GuacamoleTunnel.- Specified by:
close
in interfaceGuacamoleTunnel
- Throws:
GuacamoleException
- if an error occurs while releasing resources.
-
isOpen
public boolean isOpen()
Description copied from interface:GuacamoleTunnel
Returns whether this GuacamoleTunnel is open, or has been closed.- Specified by:
isOpen
in interfaceGuacamoleTunnel
- Returns:
- true if this GuacamoleTunnel is open, false if it is closed.
-
-