public void describeVisit(MetaDataVisitor vistor)
{
ControllerState whenRequired = getState();
try
{
KernelControllerContext context = vistor.getControllerContext();
CallbackItem<?> callback;
if (property != null)
{
if (propertyInfo == null)
{
ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData());
propertyInfo = Configurator.resolveProperty(log.isTraceEnabled(), context.getBeanInfo(), cl, property, signature);
}
callback = CallbackCreatorUtil.createCallback(context, propertyInfo, whenRequired, dependentState, cardinality);
}
else if (methodName != null)
{
if (methodInfo == null)
methodInfo = Configurator.findMethodInfo(getClassInfo(context), methodName, new String[]{signature});
callback = CallbackCreatorUtil.createCallback(context, methodInfo, whenRequired, dependentState, cardinality);
}
else
throw new IllegalArgumentException("Illegal usage - not property or method:" + this);
// add callback
addCallback(vistor, callback);
// demand name is Class in this case
if (cardinality != null)
{
vistor.addDependency(new CallbackDependencyItem(context.getName(), (Class<?>)callback.getIDependOn(), whenRequired, dependentState, cardinality));
}
}
catch (Throwable t)
{
throw new Error(t);