Skip to content

Commit

Permalink
Remove the obsolete EJBContext methods getEnvironment, getCallerIdent…
Browse files Browse the repository at this point in the history
…ity and isCallerInRole(Identity). Add overrides to prevent future removals going undetected.
  • Loading branch information
eirbjo authored and rzo1 committed Nov 15, 2023
1 parent 8a4e5d6 commit 5ce33b6
Showing 1 changed file with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -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<String, Object> getContextData() {
doCheck(Call.getContextData);
return ThreadContext.getThreadContext().get(InvocationContext.class).getContextData();
Expand All @@ -101,20 +100,23 @@ public void doCheck(final Call call) {
}
}

@Override
public EJBHome getEJBHome() {
final ThreadContext threadContext = ThreadContext.getThreadContext();
final BeanContext di = threadContext.getBeanContext();

return di.getEJBHome();
}

@Override
public EJBLocalHome getEJBLocalHome() {
final ThreadContext threadContext = ThreadContext.getThreadContext();
final BeanContext di = threadContext.getBeanContext();

return di.getEJBLocalHome();
}

@Override
public Principal getCallerPrincipal() {
doCheck(Call.getCallerPrincipal);
Principal callerPrincipal = getCallerPrincipal(securityService);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 5ce33b6

Please sign in to comment.