protected void checkExtendsAction(ComponentDef componentDef) { final Class<?> componentType = componentDef.getComponentClass(); if (LastaAction.class.isAssignableFrom(componentType)) { throwJobExtendsActionException(componentType); } }
protected void checkExtendsAction(ComponentDef componentDef) { final Class<?> componentType = componentDef.getComponentClass(); if (LastaAction.class.isAssignableFrom(componentType)) { throwLogicExtendsActionException(componentType); } }
protected void checkExtendsAction(ComponentDef componentDef) { final Class<?> componentType = componentDef.getComponentClass(); if (LastaAction.class.isAssignableFrom(componentType)) { throwAssistExtendsActionException(componentType); } }
protected void register(ComponentDef componentDef) { Class<?> componentClass = componentDef.getComponentClass(); if (componentClass == null) { return; } if (!targetInterface.isAssignableFrom(componentClass)) { return; } registerInterceptor(componentDef); }
protected void checkExtendsAction(ComponentDef componentDef) { final Class<?> componentType = componentDef.getComponentClass(); if (LastaAction.class.isAssignableFrom(componentType)) { throwJobExtendsActionException(componentType); } }
/** * @return The type object of action, non enhanced. (NotNull) */ public Class<?> getActionType() { return actionMapping.getActionDef().getComponentClass(); }
protected void checkExtendsAction(ComponentDef componentDef) { final Class<?> componentType = componentDef.getComponentClass(); if (LastaAction.class.isAssignableFrom(componentType)) { throwServiceExtendsActionException(componentType); } }
private void checkComponentClass(Object outerComponent) throws ClassUnmatchRuntimeException { Class<?> componentClass = getComponentDef().getComponentClass(); if (componentClass == null) { return; } if (!componentClass.isInstance(outerComponent)) { throw new ClassUnmatchRuntimeException(componentClass, outerComponent.getClass()); } }
protected void setResourceFieldValue(ComponentDef componentDef, Field field, Object component, Object value) throws BeanIllegalPropertyException { if (value == null) { return; } try { LdiFieldUtil.set(field, component, value); // annotation field (contains public, private) } catch (NumberFormatException ex) { throw new BeanIllegalPropertyException(componentDef.getComponentClass(), field.getName(), ex); } }
@Override public void appendInitMethod(final ComponentDef componentDef) { Class<?> componentClass = componentDef.getComponentClass(); if (componentClass == null) { return; } for (final InitMethodDefBuilder builder : initMethodDefBuilders) { builder.appendInitMethodDef(this, componentDef); } super.appendInitMethod(componentDef); }
@Override public void appendDestroyMethod(final ComponentDef componentDef) { Class<?> componentClass = componentDef.getComponentClass(); if (componentClass == null) { return; } for (final DestroyMethodDefBuilder builder : destroyMethodDefBuilders) { builder.appendDestroyMethodDef(this, componentDef); } super.appendDestroyMethod(componentDef); } }
public void appendAspectDef(final AnnotationHandler annotationHandler, final ComponentDef componentDef) { final Class<?> componentClass = componentDef.getComponentClass(); if (componentClass == null) { return; } processClass(componentDef, componentClass); processMethod(componentDef, componentClass); }
public static Class<?> getConcreteClass(final ComponentDef componentDef) { if (componentDef.getAspectDefSize() == 0 && componentDef.getInterTypeDefSize() == 0) { return componentDef.getComponentClass(); } final Map<String, ComponentDef> parameters = new HashMap<String, ComponentDef>(); parameters.put(ContainerConstants.COMPONENT_DEF_NAME, componentDef); AopProxy proxy = new AopProxy(componentDef.getComponentClass(), getAspects(componentDef), getInterTypes(componentDef), parameters); return proxy.getEnhancedClass(); }
protected String getComponentName() { String componentName = componentDef.getComponentName(); if (componentName == null) { componentName = LdiClassUtil.getShortClassName(componentDef.getComponentClass()); componentName = LdiStringUtil.decapitalize(componentName); } return componentName; }
private void invoke(BeanDesc beanDesc, Object component, String methodName, Object[] args) throws IllegalMethodRuntimeException { try { beanDesc.invoke(component, methodName, args); } catch (NumberFormatException ex) { throw new IllegalMethodRuntimeException(getComponentDef().getComponentClass(), methodName, ex); } } }
@Override public ComponentDef createComponentDef(Class<?> componentClass) { final ComponentDef componentDef = super.createComponentDef(componentClass); // null allowed if (componentDef == null) { return null; } checkExtendsAction(componentDef); if (isAppJob(componentDef.getComponentClass())) { // job assist e.g. app.job.SeaAssist checkWebReference(componentDef); } return componentDef; }
@Override public ComponentDef createComponentDef(Class<?> componentClass) { final ComponentDef componentDef = super.createComponentDef(componentClass); // null allowed if (componentDef == null) { return null; } checkExtendsAction(componentDef); if (isAppJob(componentDef.getComponentClass())) { // job assist e.g. app.job.SeaAssist checkWebReference(componentDef); } return componentDef; }
protected Object[] getArgs(Class<?>[] argTypes) { final Object[] args = new Object[argTypes.length]; for (int i = 0; i < argTypes.length; ++i) { try { args[i] = getComponentDef().getContainer().getComponent(argTypes[i]); } catch (ComponentNotFoundException e) { logger.log("WSSR0007", new Object[] { getComponentDef().getComponentClass().getName(), e.getComponentKey() }); args[i] = null; } } return args; }
private void assemble() { if (instantiating) { throw new CyclicReferenceComponentException(getComponentDef().getComponentClass()); } instantiating = true; try { component = getConstructorAssembler().assemble(); } finally { instantiating = false; } getPropertyAssembler().assemble(component); getInitMethodAssembler().assemble(component); }
protected Object assembleManual() { final Object[] args = new Object[getComponentDef().getArgDefSize()]; for (int i = 0; i < args.length; ++i) { try { args[i] = getComponentDef().getArgDef(i).getValue(Object.class); } catch (ComponentNotFoundException cause) { throw new IllegalConstructorRuntimeException(getComponentDef().getComponentClass(), cause); } } final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(getComponentDef().getConcreteClass()); return beanDesc.newInstance(args); }