|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception SK.gnome.dwarf.ServiceException SK.gnome.dwarf.IllegalServiceClassException
This exception indicates an illegal service type.
It may be thrown in the case an operation is requested on the service whose class type does not allow the operation to be performed on it.
The following code snippet ilustrates a sample usage:
public class MyService extends GenericService { ... public void init(Server parent) throws ServiceException { // accepts only MyServer as the parent server if (!(parent instanceof MyServer)) throw new IllegalServiceClassException(MyServer.class); super.init(parent); } ...
Constructors with argument of type java.lang.Class can be used to indicate the required class type.
Field Summary | |
protected java.lang.Class |
cl
The required class object. |
Constructor Summary | |
IllegalServiceClassException()
Constructs a new IllegalServiceClassException. |
|
IllegalServiceClassException(java.lang.Class cl)
Constructs a new IllegalServiceClassException with the given required class type. |
|
IllegalServiceClassException(java.lang.String message)
Constructs a new IllegalServiceClassException with the given message. |
|
IllegalServiceClassException(java.lang.String message,
java.lang.Class cl)
Constructs a new IllegalServiceClassException with the given message and required class type. |
Method Summary | |
java.lang.Class |
getRequiredClass()
Returns the required class. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Class cl
Constructor Detail |
public IllegalServiceClassException()
public IllegalServiceClassException(java.lang.String message)
message
- the messagepublic IllegalServiceClassException(java.lang.String message, java.lang.Class cl)
message
- the messagecl
- the required classpublic IllegalServiceClassException(java.lang.Class cl)
cl
- the required classMethod Detail |
public java.lang.Class getRequiredClass()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |