Package org.jboss.logmanager
Interface Protectable
-
- All Known Implementing Classes:
AsyncHandler,ConsoleHandler,DelayedHandler,ExtHandler,FileHandler,LogContext,NullHandler,OutputStreamHandler,PeriodicRotatingFileHandler,PeriodicSizeRotatingFileHandler,QueueHandler,SizeRotatingFileHandler,SocketHandler,SyslogHandler,WriterHandler
public interface ProtectableAllows objects to be locked for modification. When an object isprotected, modifications to the object are not allowed. To allow modifications for the object, theenableAccess(Object)or theunprotect(Object)methods must be invoked. To protect the object afterenablingaccess, invoke thedisableAccess()access. Note thatenablingordisablingaccess only applies to the current thread.- Author:
- James R. Perkins
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddisableAccess()Disable previous access to the object for modifications on the current thread.voidenableAccess(java.lang.Object protectKey)Enable access to the object for modifications on the current thread.voidprotect(java.lang.Object protectionKey)Protect this object from modifications.voidunprotect(java.lang.Object protectionKey)Allows the object to be modified if theprotectionKeymatches the key used toprotectthe object.
-
-
-
Method Detail
-
protect
void protect(java.lang.Object protectionKey) throws java.lang.SecurityExceptionProtect this object from modifications.- Parameters:
protectionKey- the key used to protect the object.- Throws:
java.lang.SecurityException- if the object is already protected.
-
unprotect
void unprotect(java.lang.Object protectionKey) throws java.lang.SecurityExceptionAllows the object to be modified if theprotectionKeymatches the key used toprotectthe object.- Parameters:
protectionKey- the key used to protect the object.- Throws:
java.lang.SecurityException- if the object is protected and the key doesn't match.
-
enableAccess
void enableAccess(java.lang.Object protectKey)
Enable access to the object for modifications on the current thread.- Parameters:
protectKey- the key used toprotectmodifications.
-
disableAccess
void disableAccess()
Disable previous access to the object for modifications on the current thread.
-
-