? ScopedWorkException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.osgi.service.transaction.control.ScopedWorkException
- ????????:
Serializable
An Exception that is thrown when a piece of scoped work exits with an
Exception
.
If the scope was inherited and therefore is still active when this exception
is raised then the current TransactionContext
will be available from
the ongoingContext()
method.
- ????:
-
?????
????????ScopedWorkException
(String message, Throwable cause, TransactionContext context) Creates a new TransactionException with the supplied message and cause -
????
??????????<T extends Throwable>
TThrows the cause of this Exception as a RuntimeException the supplied Exception type.<A extends Throwable,
B extends Throwable>
RuntimeExceptionThrows the cause of this Exception as a RuntimeException or one of the supplied Exception types.<A extends Throwable,
B extends Throwable, C extends Throwable>
RuntimeExceptionThrows the cause of this Exception as a RuntimeException or one of the supplied Exception types.<A extends Throwable,
B extends Throwable, C extends Throwable, D extends Throwable>
RuntimeExceptionThrows the cause of this Exception as a RuntimeException or one of the supplied Exception types.
-
???????
-
ScopedWorkException
Creates a new TransactionException with the supplied message and cause- ??:
message
-cause
-context
-
-
-
??????
-
ongoingContext
- ??:
- The ongoing transaction context if the current scope was still
active when this exception was raised or
null
otherwise. Note that this property will not be persisted during serialization.
-
asRuntimeException
- ??:
- The cause of this Exception as a
RuntimeException
if it is one, or this otherwise
-
as
Throws the cause of this Exception as a RuntimeException the supplied Exception type.Usage is of the form:
public void doStuff() throws IOException { try { ... } catch (ScopedWorkException swe) { throw swe.as(IOException.class); } }
- ??:
throwable
-- ??:
- This method will always throw an exception
- ??:
T
-
asOneOf
public <A extends Throwable,B extends Throwable> RuntimeException asOneOf(Class<A> a, Class<B> b) throws A, B Throws the cause of this Exception as a RuntimeException or one of the supplied Exception types.Usage is of the form:
public void doStuff() throws IOException, ClassNotFoundException { try { ... } catch (ScopedWorkException swe) { throw swe.asOneOf(IOException.class, ClassNotFoundException.class); } }
- ??:
a
-b
-- ??:
- This method will always throw an exception
- ??:
A
B
-
asOneOf
public <A extends Throwable,B extends Throwable, RuntimeException asOneOfC extends Throwable> (Class<A> a, Class<B> b, Class<C> c) throws A, B, C Throws the cause of this Exception as a RuntimeException or one of the supplied Exception types.- ??:
a
-b
-c
-- ??:
- This method will always throw an exception
- ??:
A
B
C extends Throwable
- ????:
-
asOneOf
public <A extends Throwable,B extends Throwable, RuntimeException asOneOfC extends Throwable, D extends Throwable> (Class<A> a, Class<B> b, Class<C> c, Class<D> d) throws A, B, C, D Throws the cause of this Exception as a RuntimeException or one of the supplied Exception types.- ??:
a
-b
-c
-d
-- ??:
- This method will always throw an exception
- ??:
A
B
C
D
- ????:
-