m_context.setTransient(bTransient);
Object[] arguments = invocation.getArguments();
Metaclass metaclass = metadata.getMetaclass(tobj.getClassName());
Selector selector = metaclass.getSelector(sEventName);
Member member;
int nArgCount;
if (arguments != null)
{
nArgCount = arguments.length;
member = selector.getMember(nArgCount);
if (member.isStatic() && tobj.getValueCount() != 0)
{
throw new RequestException("err.rpc.requestTO");
}
}
else
{
nArgCount = tobj.getValueCount();
member = selector.findMember(0);
if (member == null || member.isStatic())
{
member = selector.getMember(nArgCount);
if (!member.isStatic())
{
throw new RequestException("err.rpc.argCount",
new Object[]{member.getName(), metaclass.getName()});
}
}
else
{
nArgCount = 0;
}
}
if (member.isAttribute())
{
throw new RequestException("err.rpc.attributeInvocation",
new Object[]{member.getName(), metaclass.getName()});
}
if (m_context.isProtected() && member.getVisibility() != Metaclass.PUBLIC)
{
throw new SecurityViolationException("err.rpc.eventVisibility",
new Object[]{member.getName(), metaclass.getName()});
}
Event event = (Event)member;
Object[] args = new Object[nArgCount + 1];