From 5ce33b6345ae93590c9415d0a0cdb8b7cf55be22 Mon Sep 17 00:00:00 2001 From: Eirik Bjorsnos Date: Thu, 20 Apr 2023 08:54:41 +0200 Subject: [PATCH] Remove the obsolete EJBContext methods getEnvironment, getCallerIdentity and isCallerInRole(Identity). Add overrides to prevent future removals going undetected. --- .../org/apache/openejb/core/BaseContext.java | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java b/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java index ee3f65be104..b91eca9ca38 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java @@ -46,11 +46,9 @@ import jakarta.transaction.UserTransaction; import java.io.ObjectStreamException; import java.io.Serializable; -import java.security.Identity; import java.security.Principal; import java.util.Collection; import java.util.Map; -import java.util.Properties; /** @@ -89,6 +87,7 @@ protected IllegalStateException illegal(final Call call, final Operation operati return new IllegalStateException(call + " cannot be called in " + operation); } + @Override public Map getContextData() { doCheck(Call.getContextData); return ThreadContext.getThreadContext().get(InvocationContext.class).getContextData(); @@ -101,6 +100,7 @@ public void doCheck(final Call call) { } } + @Override public EJBHome getEJBHome() { final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); @@ -108,6 +108,7 @@ public EJBHome getEJBHome() { return di.getEJBHome(); } + @Override public EJBLocalHome getEJBLocalHome() { final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); @@ -115,6 +116,7 @@ public EJBLocalHome getEJBLocalHome() { return di.getEJBLocalHome(); } + @Override public Principal getCallerPrincipal() { doCheck(Call.getCallerPrincipal); Principal callerPrincipal = getCallerPrincipal(securityService); @@ -239,19 +241,7 @@ public boolean isUserTransactionAccessAllowed() { return di.isBeanManagedTransaction(); } - - public final Properties getEnvironment() { - throw new UnsupportedOperationException(); - } - - public final Identity getCallerIdentity() { - throw new UnsupportedOperationException(); - } - - public final boolean isCallerInRole(final Identity identity) { - throw new UnsupportedOperationException(); - } - + @Override public Object lookup(final String name) { final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext beanContext = threadContext.getBeanContext();