public Object getInstance() { return wsInvocation.getInvocationContext().getTargetBean(); } };
/** * Returns endpoint instance associated with current invocation. * * @param invocation current invocation * @return target bean in invocation */ private Object getTargetBean(final Invocation invocation) { final InvocationContext invocationContext = invocation.getInvocationContext(); return invocationContext.getTargetBean(); }
public Object getInstance() { return wsInvocation.getInvocationContext().getTargetBean(); } };
protected Object getTargetBean(Endpoint ep, Invocation epInv) { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Canot get target bean instance", ex); } } return targetBean; }
/** * Calls {@link javax.xml.rpc.server.ServiceLifecycle#destroy()} * method on target bean if this bean implements * {@link javax.xml.rpc.server.ServiceLifecycle} interface. * * @param invocation current invocation * @throws Exception if any error occurs */ @Override public void onAfterInvocation(final Invocation invocation) throws Exception { final InvocationContext invocationContext = invocation.getInvocationContext(); final Object targetBean = invocationContext.getTargetBean(); final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle; if (isJaxrpcLifecycleBean) { ((ServiceLifecycle) targetBean).destroy(); } }
protected Object getTargetBean(Endpoint ep, Invocation epInv) { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean, targetBean.getClass().getClassLoader()); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean, targetBean.getClass().getClassLoader()); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean, targetBean.getClass().getClassLoader()); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
/** * Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)} * method on target bean if this bean implements * {@link javax.xml.rpc.server.ServiceLifecycle} interface. * * @param invocation current invocation * @throws Exception if any error occurs */ @Override public void onBeforeInvocation(final Invocation invocation) throws Exception { final InvocationContext invocationContext = invocation.getInvocationContext(); final Object targetBean = invocationContext.getTargetBean(); final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle; if (isJaxrpcLifecycleBean) { final ServletEndpointContext sepContext = invocationContext.getAttachment(ServletEndpointContext.class); ((ServiceLifecycle) targetBean).init(sepContext); } }
public void invoke(Endpoint ep, Invocation epInv) throws Exception { log.debug("Invoke: " + epInv.getJavaMethod().getName()); try { InvocationContext invContext = epInv.getInvocationContext(); Object targetBean = invContext.getTargetBean(); Class implClass = targetBean.getClass(); Method seiMethod = epInv.getJavaMethod(); Method implMethod = getImplMethod(implClass, seiMethod); Object[] args = epInv.getArgs(); Object retObj = implMethod.invoke(targetBean, args); epInv.setReturnValue(retObj); } catch (Exception e) { handleInvocationException(e); } } }
protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
Object targetBean = invCtx.getTargetBean(); if (targetBean == null)
Object targetBean = invCtx.getTargetBean(); if (targetBean == null)
Object targetBean = invCtx.getTargetBean(); if (targetBean == null)
Object targetBean = invCtx.getTargetBean(); if (targetBean == null)
Object targetBean = invCtx.getTargetBean(); if (targetBean == null)
Object targetBean = invCtx.getTargetBean(); if (targetBean == null)