Methods Summary |
---|
public java.util.List | getAllInvocations()
return (ArrayList) frames.get();
|
public com.sun.enterprise.ComponentInvocation | getCurrentInvocation()return the Invocation object of the component
being called
// END IASRI# 4646060
ArrayList v = (ArrayList) frames.get();
int size = v.size();
// BEGIN IASRI# 4646060
if (size == 0) return null;
// END IASRI# 4646060
return (ComponentInvocation) v.get(size-1);
|
public com.sun.enterprise.ComponentInvocation | getPreviousInvocation()return the Inovcation object of the caller
return null if none exist (e.g. caller is from
another VM)
ArrayList v = (ArrayList) frames.get();
int i = v.size();
if (i < 2) return null;
return (ComponentInvocation) v.get(i - 2);
|
public boolean | isInvocationStackEmpty()return true iff no invocations on the stack for this thread
ArrayList v = (ArrayList) frames.get();
return (v.size() == 0);
|
public boolean | isStartupInvocation()
if (frames != null) {
InvocationArray v = (InvocationArray) frames.get();
if (v != null) {
return v.outsideStartup() == false;
}
}
return false;
|
public void | postInvoke(com.sun.enterprise.ComponentInvocation inv)
// START OF IASRI 4660742
if (debug && _logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,"IM: postInvoke" + inv.instance);
}
// END OF IASRI 4660742
int invType = inv.getInvocationType();
// Get this thread's ArrayList
InvocationArray v = (InvocationArray) frames.get();
if (invType == ComponentInvocation.SERVICE_STARTUP) {
v.setInvocationAttribute(ComponentInvocation.UN_INITIALIZED);
return;
}
int size = v.size();
if (size == 0)
throw new InvocationException();
try {
// if ejb call EJBSecurityManager, for servlet call RealmAdapter
if (invType == inv.EJB_INVOCATION){
SecurityManager sm =
((Container)inv.getContainerContext()).getSecurityManager();
sm.postInvoke(inv);
} else if (invType == inv.SERVLET_INVOCATION){
Realm rlm = ((Context)inv.getContainerContext()).getRealm();
if (rlm instanceof RealmAdapter) {
RealmAdapter rad = (RealmAdapter) rlm;
rad.postSetRunAsIdentity (inv);
}// else {
// throw new InvocationException();
// }
}
// Get current and previous ComponentInvocation objects
ComponentInvocation prev, curr;
if (size < 2)
prev = null;
else
prev = (ComponentInvocation)v.get(size - 2);
curr = (ComponentInvocation)v.get(size - 1);
tm.postInvoke(curr, prev);
Switch.getSwitch().getPoolManager().postInvoke();
}
finally {
// pop the stack
v.remove(size - 1);
}
|
public void | preInvoke(com.sun.enterprise.ComponentInvocation inv)
// START OF IASRI 4660742
if (debug && _logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,"IM: preInvoke" + inv.instance);
}
// END OF IASRI 4660742
int invType = inv.getInvocationType();
// Get this thread's ArrayList
InvocationArray v = (InvocationArray) frames.get();
if (invType == ComponentInvocation.SERVICE_STARTUP) {
v.setInvocationAttribute(ComponentInvocation.SERVICE_STARTUP);
return;
}
// if ejb call EJBSecurityManager, for servlet call RealmAdapter
if (invType == inv.EJB_INVOCATION) {
SecurityManager sm =
((Container)inv.getContainerContext()).getSecurityManager();
sm.preInvoke(inv);
} else if (invType == inv.SERVLET_INVOCATION){
Realm rlm = ((Context)inv.getContainerContext()).getRealm();
if (rlm instanceof RealmAdapter) {
RealmAdapter rad = (RealmAdapter) rlm;
rad.preSetRunAsIdentity(inv);
}
}
// push this invocation on the stack
v.add(inv);
// Get the previous invocation on the stack
int size = v.size();
ComponentInvocation prev;
if (size < 2)
prev = null;
else
prev = (ComponentInvocation) v.get(size - 2);
// Call the TM
if (tm == null)
tm = Switch.getSwitch().getTransactionManager();
tm.preInvoke(prev);
|