protected String buildActionName(ComponentDef actionDef) { return actionDef.getComponentName(); }
protected String buildActionName(ComponentDef actionDef) { return actionDef.getComponentName(); }
protected boolean isSimpleNamingAutoBindable(String propertyName, Class<?> propertyType, ComponentDef cd) { final String componentName = cd.getComponentName(); if (componentName == null) { return false; } if (componentName.equals(propertyName)) { // e.g. seaLogic for SeaLogic return true; } if (componentName.endsWith(ContainerConstants.PACKAGE_SEP + propertyName)) { // e.g. sea[_landLogic] return true; } return false; }
protected void registerByName(ComponentDef componentDef) { String componentName = componentDef.getComponentName(); if (componentName != null) { registerMap(componentName, componentDef); } }
protected void registerByName(ComponentDef componentDef) { final String componentName = componentDef.getComponentName(); if (componentName != null) { registerMap(componentName, componentDef); } }
protected String buildFormKey() { return actionMapping.getActionDef().getComponentName() + "_" + mappingMethodName + "_Form"; }
protected String buildFormKey() { return actionMapping.getActionDef().getComponentName() + "_" + mappingMethodName + "_Form"; }
public static void putRegisterLog(final ComponentDef cd) { if (logger.isDebugEnabled()) { final StringBuffer buf = new StringBuffer(100); final Class<?> componentClass = cd.getComponentClass(); if (componentClass != null) { buf.append(componentClass.getName()); } final String componentName = cd.getComponentName(); if (!LdiStringUtil.isEmpty(componentName)) { buf.append("[").append(componentName).append("]"); } logger.log("DSSR0105", new Object[] { new String(buf) }); } } }
protected ComponentDef findComponentDef(String name) { if (name == null) { return null; } LaContainer container = getContainer(); for (int i = 0; i < container.getComponentDefSize(); ++i) { ComponentDef cd = container.getComponentDef(i); if (name.equals(cd.getComponentName())) { return cd; } } return null; }
protected LaContainer redefine(ComponentDef componentDef, String path, RedefinableXmlLaContainerBuilder builder) { int delimiter = path.lastIndexOf(DELIMITER); int slash = path.lastIndexOf('/'); if (delimiter >= 0 && delimiter > slash) { // e.g. jta+userTransaction.xml, jta++.xml return null; // no handling if the resource name contains '+' } final String name = componentDef.getComponentName(); final String[] diconPaths = constructRedifinitionDiconPaths(path, name); String diconPath = null; for (int i = 0; i < diconPaths.length; i++) { if (LaContainerBuilderUtils.resourceExists(diconPaths[i], builder)) { diconPath = diconPaths[i]; break; } } if (diconPath == null) { return null; } return LaContainerFactory.create(diconPath); }
protected String getComponentName() { String componentName = componentDef.getComponentName(); if (componentName == null) { componentName = LdiClassUtil.getShortClassName(componentDef.getComponentClass()); componentName = LdiStringUtil.decapitalize(componentName); } return componentName; }
protected void invokePreparerMethod(Object component, MethodDef methodDef) { try { methodDef.getMethod().invoke(methodDef.getArgs()[0], new Object[] { component }); } catch (IllegalArgumentException ex) { throw new IllegalMethodRuntimeException(getComponentClass(component), getComponentDef().getComponentName(), ex); } catch (IllegalAccessException ex) { throw new IllegalMethodRuntimeException(getComponentClass(component), getComponentDef().getComponentName(), ex); } catch (InvocationTargetException ex) { throw new IllegalMethodRuntimeException(getComponentClass(component), getComponentDef().getComponentName(), ex); } } }
void invokePreparerMethod(Object component, MethodDef methodDef) { try { methodDef.getMethod().invoke(methodDef.getArgs()[0], new Object[] { component }); } catch (IllegalArgumentException ex) { throw new IllegalMethodRuntimeException(getComponentClass(component), getComponentDef().getComponentName(), ex); } catch (IllegalAccessException ex) { throw new IllegalMethodRuntimeException(getComponentClass(component), getComponentDef().getComponentName(), ex); } catch (InvocationTargetException ex) { throw new IllegalMethodRuntimeException(getComponentClass(component), getComponentDef().getComponentName(), ex); } } }
ComponentDef redefine(ComponentDef componentDef, String path) { String name = componentDef.getComponentName(); String diconPath = constructRedifinitionDiconPath(path, name); if (!LaContainerBuilderUtils.resourceExists(diconPath, this)) { return componentDef; } LaContainer container = LaContainerFactory.create(diconPath); if (!container.hasComponentDef(name)) { throw new RuntimeException("Can't find component definition named '" + name + "' in " + diconPath); } return container.getComponentDef(name); }
void registerComponentDef(LaContainer container, Method method, LaContainerPreparer preparer) { ComponentDef componentDef = constructComponentDef(method, preparer); if (componentDef.getComponentName() != null) { componentDef = redefine(componentDef, container.getPath()); } container.register(componentDef); }
public NextJourney createNextJourney(PlannedJourneyProvider journeyProvider, HtmlResponse response) { // almost copied from super String path = response.getRoutingPath(); final boolean redirectTo = response.isRedirectTo(); if (path.indexOf(":") < 0) { if (!path.startsWith("/")) { path = buildActionPath(getActionDef().getComponentName()) + path; } if (!redirectTo && isHtmlForward(path)) { path = filterHtmlPath(path); } } return newNextJourney(journeyProvider, path, redirectTo, response.isAsIs(), response.getViewObject()); }
public NextJourney createNextJourney(PlannedJourneyProvider journeyProvider, HtmlResponse response) { // almost copied from super String path = response.getRoutingPath(); final boolean redirectTo = response.isRedirectTo(); if (path.indexOf(":") < 0) { if (!path.startsWith("/")) { path = buildActionPath(getActionDef().getComponentName()) + path; } if (!redirectTo && isHtmlForward(path)) { path = filterHtmlPath(path); } } return newNextJourney(journeyProvider, path, redirectTo, response.isAsIs(), response.getViewObject()); }
protected ComponentDef actuallyCreateComponentDef(Class<?> implType) { final Class<?> targetClass = namingConvention.toCompleteClass(implType); checkImplementationCanBeCreated(targetClass); final AnnotationHandler handler = AnnotationHandlerFactory.getAnnotationHandler(); final ComponentDef cd = handler.createComponentDef(targetClass, instanceDef, autoBindingDef, externalBinding); if (cd.getComponentName() == null) { cd.setComponentName(deriveComponentName(targetClass)); } handler.appendDI(cd); customizer.customize(cd); handler.appendInitMethod(cd); handler.appendDestroyMethod(cd); handler.appendAspect(cd); handler.appendInterType(cd); return cd; }
protected ComponentDef actuallyCreateComponentDef(Class<?> implType) { final Class<?> targetClass = namingConvention.toCompleteClass(implType); checkImplementationCanBeCreated(targetClass); final AnnotationHandler handler = AnnotationHandlerFactory.getAnnotationHandler(); final ComponentDef cd = handler.createComponentDef(targetClass, instanceDef, autoBindingDef, externalBinding); if (cd.getComponentName() == null) { cd.setComponentName(deriveComponentName(targetClass)); } handler.appendDI(cd); customizer.customize(cd); handler.appendInitMethod(cd); handler.appendDestroyMethod(cd); handler.appendAspect(cd); handler.appendInterType(cd); return cd; }
protected void register(final String className) { final AnnotationHandler annoHandler = AnnotationHandlerFactory.getAnnotationHandler(); final ComponentDef cd = annoHandler.createComponentDef(className, instanceDef, autoBindingDef, externalBinding); if (cd.getComponentName() == null) { String[] names = LdiClassUtil.splitPackageAndShortClassName(className); cd.setComponentName(autoNaming.defineName(names[0], names[1])); } annoHandler.appendDI(cd); customize(cd); annoHandler.appendInitMethod(cd); annoHandler.appendDestroyMethod(cd); annoHandler.appendAspect(cd); annoHandler.appendInterType(cd); getContainer().register(cd); }