THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
@Scope(ScopeType.PROTOTYPE) @Provider public class MyProvider implements MessageBodyReader<String>{ ... } |
Singleton Example 1
The following example shows how to define a provider with a singleton lifecycle.
Code Block | ||||
---|---|---|---|---|
| ||||
@Scope(ScopeType.SINGELTON) @Provider public class MyProvider implements MessageBodyReader<String>{ ... } |
Singleton Example 2
The following example shows that when the @Scope annotation is not used, the provider will be a singleton, as per the JAX-RS specification.
...