Package org.apache.guacamole.net
Class AbstractGuacamoleTunnel
- java.lang.Object
- 
- org.apache.guacamole.net.AbstractGuacamoleTunnel
 
- 
- All Implemented Interfaces:
- GuacamoleTunnel
 - Direct Known Subclasses:
- SimpleGuacamoleTunnel
 
 public abstract class AbstractGuacamoleTunnel extends Object implements GuacamoleTunnel Base GuacamoleTunnel implementation which synchronizes access to the underlying reader and writer with reentrant locks. Implementations need only provide the tunnel's UUID and socket.
- 
- 
Field Summary- 
Fields inherited from interface org.apache.guacamole.net.GuacamoleTunnelINTERNAL_DATA_OPCODE
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractGuacamoleTunnel()Creates a new GuacamoleTunnel which synchronizes access to the Guacamole instruction stream associated with the underlying GuacamoleSocket.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description GuacamoleReaderacquireReader()Acquires exclusive read access to the Guacamole instruction stream and returns a GuacamoleReader for reading from that stream.GuacamoleWriteracquireWriter()Acquires exclusive write access to the Guacamole instruction stream and returns a GuacamoleWriter for writing to that stream.voidclose()Release all resources allocated to this GuacamoleTunnel.booleanhasQueuedReaderThreads()Returns whether there are threads waiting for read access to the Guacamole instruction stream.booleanhasQueuedWriterThreads()Returns whether there are threads waiting for write access to the Guacamole instruction stream.booleanisOpen()Returns whether this GuacamoleTunnel is open, or has been closed.voidreleaseReader()Relinquishes exclusive read access to the Guacamole instruction stream.voidreleaseWriter()Relinquishes exclusive write access to the Guacamole instruction stream.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.guacamole.net.GuacamoleTunnelgetSocket, getUUID
 
- 
 
- 
- 
- 
Method Detail- 
acquireReaderpublic GuacamoleReader acquireReader() Acquires exclusive read access to the Guacamole instruction stream and returns a GuacamoleReader for reading from that stream.- Specified by:
- acquireReaderin interface- GuacamoleTunnel
- Returns:
- A GuacamoleReader for reading from the Guacamole instruction stream.
 
 - 
releaseReaderpublic void releaseReader() 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:
- releaseReaderin interface- GuacamoleTunnel
 
 - 
hasQueuedReaderThreadspublic boolean hasQueuedReaderThreads() Returns whether there are threads waiting for read access to the Guacamole instruction stream.- Specified by:
- hasQueuedReaderThreadsin interface- GuacamoleTunnel
- Returns:
- true if threads are waiting for read access the Guacamole instruction stream, false otherwise.
 
 - 
acquireWriterpublic GuacamoleWriter acquireWriter() Acquires exclusive write access to the Guacamole instruction stream and returns a GuacamoleWriter for writing to that stream.- Specified by:
- acquireWriterin interface- GuacamoleTunnel
- Returns:
- A GuacamoleWriter for writing to the Guacamole instruction stream.
 
 - 
releaseWriterpublic void releaseWriter() 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:
- releaseWriterin interface- GuacamoleTunnel
 
 - 
hasQueuedWriterThreadspublic boolean hasQueuedWriterThreads() Description copied from interface:GuacamoleTunnelReturns whether there are threads waiting for write access to the Guacamole instruction stream.- Specified by:
- hasQueuedWriterThreadsin interface- GuacamoleTunnel
- Returns:
- true if threads are waiting for write access the Guacamole instruction stream, false otherwise.
 
 - 
closepublic void close() throws GuacamoleExceptionDescription copied from interface:GuacamoleTunnelRelease all resources allocated to this GuacamoleTunnel.- Specified by:
- closein interface- GuacamoleTunnel
- Throws:
- GuacamoleException- if an error occurs while releasing resources.
 
 - 
isOpenpublic boolean isOpen() Description copied from interface:GuacamoleTunnelReturns whether this GuacamoleTunnel is open, or has been closed.- Specified by:
- isOpenin interface- GuacamoleTunnel
- Returns:
- true if this GuacamoleTunnel is open, false if it is closed.
 
 
- 
 
-