Invocation invocation = new Invocation( null, GET_EJB_OBJECT,
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; } }
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; } }
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; } }
final org.jboss.invocation.Invocation jbossInvocation = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
final org.jboss.invocation.Invocation jbossInvocation = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
final org.jboss.invocation.Invocation jbossInvocation = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }
org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }
public Object invoke(final Object proxy, final Method m, Object[] args) throws Throwable { // Normalize args to always be an array // Isn't this a bug in the proxy call?? if (args == null) args = EMPTY_ARGS; // Create the invocation object Invocation invocation = new Invocation(); // Contextual information for the interceptors invocation.setInvocationContext(context); invocation.setId(context.getCacheId()); invocation.setObjectName(context.getObjectName()); invocation.setMethod(m); invocation.setArguments(args); invocation.setValue(InvocationKey.INVOKER_PROXY_BINDING, context.getInvokerProxyBinding(), PayloadKey.AS_IS); // send the invocation down the client interceptor chain Object obj = next.invoke(invocation); return obj; }
try Invocation inv = new Invocation(timedObjectId.getInstancePk(), method, new Object[]{timer}, null, null, null); inv.setValue(InvocationKey.INVOKER_PROXY_BINDING, null, PayloadKey.AS_IS); inv.setType(InvocationType.LOCAL);