Skip to content

Commit ff46cdb

Browse files
committed
Removed RunContextProducer, ServerRunContextProducer
Moved @RunWithRunContext to jax-ws module
1 parent 5daa3a0 commit ff46cdb

2 files changed

Lines changed: 8 additions & 20 deletions

File tree

code/contacts/org.eclipse.scout.contacts.server/src/main/java/org/eclipse/scout/contacts/server/sql/SuperUserRunContextProducer.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import jakarta.annotation.PostConstruct;
1515

1616
import org.eclipse.scout.contacts.server.sql.DatabaseProperties.SuperUserSubjectProperty;
17+
import org.eclipse.scout.rt.platform.ApplicationScoped;
1718
import org.eclipse.scout.rt.platform.BEANS;
1819
import org.eclipse.scout.rt.platform.IPlatform.State;
1920
import org.eclipse.scout.rt.platform.IPlatformListener;
@@ -24,19 +25,19 @@
2425
import org.eclipse.scout.rt.platform.exception.PlatformException;
2526
import org.eclipse.scout.rt.platform.util.FinalValue;
2627
import org.eclipse.scout.rt.server.context.ServerRunContext;
27-
import org.eclipse.scout.rt.server.context.ServerRunContextProducer;
2828
import org.eclipse.scout.rt.server.session.IServerSession;
2929
import org.eclipse.scout.rt.server.session.ServerSessionProvider;
3030
import org.eclipse.scout.rt.server.session.context.ServerSessionRunContext;
3131
import org.eclipse.scout.rt.server.session.context.ServerSessionRunContexts;
3232
import org.eclipse.scout.rt.shared.ui.UserAgents;
3333

3434
/**
35-
* Central point to obtain run contexts with super user rights, and to get the super user subject and session.
35+
* Central point to obtain run contexts with super-user rights, and to get the super-user subject and session.
3636
* <p>
37-
* A super user run context is a {@link ServerRunContext} with a user that has administrator privileges.
37+
* A super-user run context is a {@link ServerRunContext} with a user that has administrator privileges.
3838
*/
39-
public class SuperUserRunContextProducer extends ServerRunContextProducer {
39+
@ApplicationScoped
40+
public class SuperUserRunContextProducer {
4041

4142
private final FinalValue<IServerSession> session = new FinalValue<>();
4243
private final FinalValue<Subject> subject = new FinalValue<>();
@@ -46,20 +47,6 @@ protected void initSuperUserSubject() {
4647
subject.set(CONFIG.getPropertyValue(SuperUserSubjectProperty.class));
4748
}
4849

49-
/**
50-
* Produces a new {@link ServerRunContext} with super user rights.
51-
* <p>
52-
* This method delegates to {@link #produce()}, meaning that the subject specified is ignored.
53-
*
54-
* @param subject
55-
* is ignored, and {@link SuperUserRunContextProducer#getSubject()} used instead.
56-
* @see #produce()
57-
*/
58-
@Override
59-
public final ServerRunContext produce(final Subject inputSubject) {
60-
return produce();
61-
}
62-
6350
/**
6451
* Produces a new {@link ServerRunContext} with super user rights.
6552
* <p>

code/org.eclipse.scout.docs.snippets/src/main/java/org/eclipse/scout/docs/snippets/JaxWsSnippet.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import java.util.concurrent.Callable;
1818
import java.util.concurrent.TimeUnit;
1919

20+
import javax.xml.namespace.QName;
21+
2022
import jakarta.annotation.Generated;
2123
import jakarta.annotation.Resource;
2224
import jakarta.jws.HandlerChain;
@@ -26,7 +28,6 @@
2628
import jakarta.jws.WebService;
2729
import jakarta.jws.soap.SOAPBinding;
2830
import jakarta.jws.soap.SOAPBinding.ParameterStyle;
29-
import javax.xml.namespace.QName;
3031
import jakarta.xml.ws.WebServiceContext;
3132
import jakarta.xml.ws.handler.MessageContext;
3233
import jakarta.xml.ws.handler.MessageContext.Scope;
@@ -41,12 +42,12 @@
4142
import org.eclipse.scout.rt.platform.config.AbstractStringConfigProperty;
4243
import org.eclipse.scout.rt.platform.config.IConfigProperty;
4344
import org.eclipse.scout.rt.platform.context.RunContext;
44-
import org.eclipse.scout.rt.platform.context.RunWithRunContext;
4545
import org.eclipse.scout.rt.platform.exception.DefaultExceptionTranslator;
4646
import org.eclipse.scout.rt.platform.security.ConfigFileCredentialVerifier;
4747
import org.eclipse.scout.rt.server.jaxws.consumer.AbstractWebServiceClient;
4848
import org.eclipse.scout.rt.server.jaxws.consumer.InvocationContext;
4949
import org.eclipse.scout.rt.server.jaxws.consumer.auth.handler.BasicAuthenticationHandler;
50+
import org.eclipse.scout.rt.server.jaxws.context.RunWithRunContext;
5051
import org.eclipse.scout.rt.server.jaxws.handler.LogHandler;
5152
import org.eclipse.scout.rt.server.jaxws.handler.WsConsumerCorrelationIdHandler;
5253
import org.eclipse.scout.rt.server.jaxws.handler.WsProviderCorrelationIdHandler;

0 commit comments

Comments
 (0)