本文整理汇总了Java中org.apache.aries.blueprint.mutable.MutableBeanMetadata.setId方法的典型用法代码示例。如果您正苦于以下问题:Java MutableBeanMetadata.setId方法的具体用法?Java MutableBeanMetadata.setId怎么用?Java MutableBeanMetadata.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.aries.blueprint.mutable.MutableBeanMetadata
的用法示例。
在下文中一共展示了MutableBeanMetadata.setId方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBeanMetadata
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private static MutableBeanMetadata createBeanMetadata(final ParserContext context, final String id,
final Class<?> runtimeClass, final boolean initMethod, final boolean destroyMethod) {
MutableBeanMetadata metadata = context.createMetadata(MutableBeanMetadata.class);
metadata.setId(id);
metadata.setScope(BeanMetadata.SCOPE_SINGLETON);
metadata.setActivation(ReferenceMetadata.ACTIVATION_EAGER);
metadata.setRuntimeClass(runtimeClass);
if (initMethod) {
metadata.setInitMethod("init");
}
if (destroyMethod) {
metadata.setDestroyMethod("destroy");
}
return metadata;
}
示例2: createBeanMetadata
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
public MutableBeanMetadata createBeanMetadata(Element element, ParserContext context, Class<?> runtimeClass) {
MutableBeanMetadata answer = context.createMetadata(MutableBeanMetadata.class);
answer.setRuntimeClass(runtimeClass);
answer.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
answer.addProperty("bundleContext", createRef(context, "blueprintBundleContext"));
// set the Bean scope to be prototype, so we can get a new instance per looking up
answer.setScope(BeanMetadata.SCOPE_PROTOTYPE);
if (!StringUtils.isEmpty(getIdOrName(element))) {
answer.setId(getIdOrName(element));
} else {
// TODO we may need to throw exception for it
answer.setId("camel.cxf.endpoint." + runtimeClass.getSimpleName() + "." + context.generateId());
}
return answer;
}
示例3: registerBean
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
protected void registerBean(ParserContext context, String contextId, AbstractCamelFactoryBean<?> fact) {
String id = fact.getId();
fact.setCamelContextId(contextId);
MutablePassThroughMetadata eff = context.createMetadata(MutablePassThroughMetadata.class);
eff.setId(".camelBlueprint.bean.passthrough." + id);
eff.setObject(new PassThroughCallable<Object>(fact));
MutableBeanMetadata ef = context.createMetadata(MutableBeanMetadata.class);
ef.setId(".camelBlueprint.bean.factory." + id);
ef.setFactoryComponent(eff);
ef.setFactoryMethod("call");
ef.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
ef.setInitMethod("afterPropertiesSet");
ef.setDestroyMethod("destroy");
MutableBeanMetadata e = context.createMetadata(MutableBeanMetadata.class);
e.setId(id);
e.setRuntimeClass(fact.getObjectType());
e.setFactoryComponent(ef);
e.setFactoryMethod("getObject");
e.addDependsOn(".camelBlueprint.processor.bean." + contextId);
context.getComponentDefinitionRegistry().registerComponentDefinition(e);
}
示例4: parseElement
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private void parseElement(Element elt, ParserContext pc) {
ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
if ("enable".equals(elt.getLocalName()) &&
!cdr.containsComponentDefinition(JpaComponentProcessor.class.getSimpleName())) {
MutableBeanMetadata meta = pc.createMetadata(MutableBeanMetadata.class);
meta.setId(JpaComponentProcessor.class.getSimpleName());
meta.setRuntimeClass(JpaComponentProcessor.class);
meta.setProcessor(true);
meta.addProperty("pc", passThrough(pc, pc));
cdr.registerComponentDefinition(meta);
}
}
示例5: authBeanProcessor
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private MutableBeanMetadata authBeanProcessor( ParserContext pc, ComponentDefinitionRegistry cdr )
{
MutableBeanMetadata meta = pc.createMetadata( MutableBeanMetadata.class );
meta.setId( AuthorizationBeanProcessor.AUTH_PROCESSOR_BEAN_NAME );
meta.setRuntimeClass( AuthorizationBeanProcessor.class );
meta.setProcessor( true );
meta.addProperty( "cdr", passThrough( pc, cdr ) );
return meta;
}
示例6: parseContainerElement
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseContainerElement(Element element, ParserContext parserContext) {
final MutableBeanMetadata bean = parserContext.createMetadata(MutableBeanMetadata.class);
final String quietPeriodInMs = Optional.ofNullable(StringUtils.trimToNull(element.getAttribute(QUIET_PERIOD_IN_MS_ATTR))).orElse(String.valueOf(defaultQuietPeriodInMs));
bean.setClassName(OsgiContainer.class.getName());
bean.setRuntimeClass(OsgiContainer.class);
bean.setId(element.getAttribute(ID_ATTR));
bean.addDependsOn(BUNDLE_CONTEXT_ID);
bean.addArgument(bundleContextRef(parserContext), BundleContext.class.getName(), 0);
bean.addArgument(value(parserContext, quietPeriodInMs, Long.TYPE), Long.TYPE.getName(), 1);
return bean;
}
示例7: parseProxyElement
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
protected Metadata parseProxyElement(Element element, ParserContext parserContext) {
whenNotExists(parserContext, JAXRS_PROXY_FACTORY_ID, this::createJaxrsProxyFactoryReference);
MutableBeanMetadata bean = parserContext.createMetadata(MutableBeanMetadata.class);
bean.setId(element.getAttribute(ID_ATTR));
bean.addDependsOn(JAXRS_PROXY_FACTORY_ID);
bean.setRuntimeClass(JaxrsProxyFactory.class);
bean.setFactoryComponent(ref(parserContext, JAXRS_PROXY_FACTORY_ID));
bean.setFactoryMethod(CREATE_PROXY_METHOD);
bean.addArgument(value(parserContext, serviceInterfaceOf(element), Class.class), Class.class.getName(), 0);
LOGGER.debug("Created proxy bean: {}", bean);
return bean;
}
示例8: createBeanMetadata
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
public MutableBeanMetadata createBeanMetadata(Element element, ParserContext context, Class<?> runtimeClass) {
MutableBeanMetadata answer = context.createMetadata(MutableBeanMetadata.class);
answer.setRuntimeClass(runtimeClass);
if (!StringUtils.isEmpty(getIdOrName(element))) {
answer.setId(getIdOrName(element));
} else {
// TODO we may need to throw exception for it
answer.setId("camel.cxf.transport." + runtimeClass.getSimpleName() + "." + context.generateId());
}
return answer;
}
示例9: parseRestContextNode
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseRestContextNode(Element element, ParserContext context) {
LOG.trace("Parsing RestContext {}", element);
// now parse the rests with JAXB
Binder<Node> binder;
try {
binder = getJaxbContext().createBinder();
} catch (JAXBException e) {
throw new ComponentDefinitionException("Failed to create the JAXB binder : " + e, e);
}
Object value = parseUsingJaxb(element, context, binder);
if (!(value instanceof CamelRestContextFactoryBean)) {
throw new ComponentDefinitionException("Expected an instance of " + CamelRestContextFactoryBean.class);
}
CamelRestContextFactoryBean rcfb = (CamelRestContextFactoryBean) value;
String id = rcfb.getId();
MutablePassThroughMetadata factory = context.createMetadata(MutablePassThroughMetadata.class);
factory.setId(".camelBlueprint.passThrough." + id);
factory.setObject(new PassThroughCallable<Object>(rcfb));
MutableBeanMetadata factory2 = context.createMetadata(MutableBeanMetadata.class);
factory2.setId(".camelBlueprint.factory." + id);
factory2.setFactoryComponent(factory);
factory2.setFactoryMethod("call");
MutableBeanMetadata ctx = context.createMetadata(MutableBeanMetadata.class);
ctx.setId(id);
ctx.setRuntimeClass(List.class);
ctx.setFactoryComponent(factory2);
ctx.setFactoryMethod("getRests");
// must be lazy as we want CamelContext to be activated first
ctx.setActivation(ACTIVATION_LAZY);
// lets inject the namespaces into any namespace aware POJOs
injectNamespaces(element, binder);
LOG.trace("Parsing RestContext done, returning {}", element, ctx);
return ctx;
}
示例10: parseEndpointNode
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseEndpointNode(Element element, ParserContext context) {
LOG.trace("Parsing Endpoint {}", element);
// now parse the rests with JAXB
Binder<Node> binder;
try {
binder = getJaxbContext().createBinder();
} catch (JAXBException e) {
throw new ComponentDefinitionException("Failed to create the JAXB binder : " + e, e);
}
Object value = parseUsingJaxb(element, context, binder);
if (!(value instanceof CamelEndpointFactoryBean)) {
throw new ComponentDefinitionException("Expected an instance of " + CamelEndpointFactoryBean.class);
}
CamelEndpointFactoryBean rcfb = (CamelEndpointFactoryBean) value;
String id = rcfb.getId();
MutablePassThroughMetadata factory = context.createMetadata(MutablePassThroughMetadata.class);
factory.setId(".camelBlueprint.passThrough." + id);
factory.setObject(new PassThroughCallable<Object>(rcfb));
MutableBeanMetadata factory2 = context.createMetadata(MutableBeanMetadata.class);
factory2.setId(".camelBlueprint.factory." + id);
factory2.setFactoryComponent(factory);
factory2.setFactoryMethod("call");
factory2.setInitMethod("afterPropertiesSet");
factory2.setDestroyMethod("destroy");
factory2.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
MutableBeanMetadata ctx = context.createMetadata(MutableBeanMetadata.class);
ctx.setId(id);
ctx.setRuntimeClass(Endpoint.class);
ctx.setFactoryComponent(factory2);
ctx.setFactoryMethod("getObject");
// must be lazy as we want CamelContext to be activated first
ctx.setActivation(ACTIVATION_LAZY);
LOG.trace("Parsing endpoint done, returning {}", element, ctx);
return ctx;
}
示例11: parseKeyStoreParametersNode
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseKeyStoreParametersNode(Element element, ParserContext context) {
LOG.trace("Parsing KeyStoreParameters {}", element);
// now parse the key store parameters with JAXB
Binder<Node> binder;
try {
binder = getJaxbContext().createBinder();
} catch (JAXBException e) {
throw new ComponentDefinitionException("Failed to create the JAXB binder : " + e, e);
}
Object value = parseUsingJaxb(element, context, binder);
if (!(value instanceof KeyStoreParametersFactoryBean)) {
throw new ComponentDefinitionException("Expected an instance of " + KeyStoreParametersFactoryBean.class);
}
KeyStoreParametersFactoryBean kspfb = (KeyStoreParametersFactoryBean) value;
String id = kspfb.getId();
MutablePassThroughMetadata factory = context.createMetadata(MutablePassThroughMetadata.class);
factory.setId(".camelBlueprint.passThrough." + id);
factory.setObject(new PassThroughCallable<Object>(kspfb));
MutableBeanMetadata factory2 = context.createMetadata(MutableBeanMetadata.class);
factory2.setId(".camelBlueprint.factory." + id);
factory2.setFactoryComponent(factory);
factory2.setFactoryMethod("call");
factory2.setInitMethod("afterPropertiesSet");
factory2.setDestroyMethod("destroy");
factory2.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
MutableBeanMetadata ctx = context.createMetadata(MutableBeanMetadata.class);
ctx.setId(id);
ctx.setRuntimeClass(KeyStoreParameters.class);
ctx.setFactoryComponent(factory2);
ctx.setFactoryMethod("getObject");
// must be lazy as we want CamelContext to be activated first
ctx.setActivation(ACTIVATION_LAZY);
LOG.trace("Parsing KeyStoreParameters done, returning {}", ctx);
return ctx;
}
示例12: parseSecureRandomParametersNode
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseSecureRandomParametersNode(Element element, ParserContext context) {
LOG.trace("Parsing SecureRandomParameters {}", element);
// now parse the key store parameters with JAXB
Binder<Node> binder;
try {
binder = getJaxbContext().createBinder();
} catch (JAXBException e) {
throw new ComponentDefinitionException("Failed to create the JAXB binder : " + e, e);
}
Object value = parseUsingJaxb(element, context, binder);
if (!(value instanceof SecureRandomParametersFactoryBean)) {
throw new ComponentDefinitionException("Expected an instance of " + SecureRandomParametersFactoryBean.class);
}
SecureRandomParametersFactoryBean srfb = (SecureRandomParametersFactoryBean) value;
String id = srfb.getId();
MutablePassThroughMetadata factory = context.createMetadata(MutablePassThroughMetadata.class);
factory.setId(".camelBlueprint.passThrough." + id);
factory.setObject(new PassThroughCallable<Object>(srfb));
MutableBeanMetadata factory2 = context.createMetadata(MutableBeanMetadata.class);
factory2.setId(".camelBlueprint.factory." + id);
factory2.setFactoryComponent(factory);
factory2.setFactoryMethod("call");
factory2.setInitMethod("afterPropertiesSet");
factory2.setDestroyMethod("destroy");
factory2.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
MutableBeanMetadata ctx = context.createMetadata(MutableBeanMetadata.class);
ctx.setId(id);
ctx.setRuntimeClass(SecureRandomParameters.class);
ctx.setFactoryComponent(factory2);
ctx.setFactoryMethod("getObject");
// must be lazy as we want CamelContext to be activated first
ctx.setActivation(ACTIVATION_LAZY);
LOG.trace("Parsing SecureRandomParameters done, returning {}", ctx);
return ctx;
}
示例13: parseSSLContextParametersNode
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseSSLContextParametersNode(Element element, ParserContext context) {
LOG.trace("Parsing SSLContextParameters {}", element);
// now parse the key store parameters with JAXB
Binder<Node> binder;
try {
binder = getJaxbContext().createBinder();
} catch (JAXBException e) {
throw new ComponentDefinitionException("Failed to create the JAXB binder : " + e, e);
}
Object value = parseUsingJaxb(element, context, binder);
if (!(value instanceof SSLContextParametersFactoryBean)) {
throw new ComponentDefinitionException("Expected an instance of " + SSLContextParametersFactoryBean.class);
}
SSLContextParametersFactoryBean scpfb = (SSLContextParametersFactoryBean) value;
String id = scpfb.getId();
MutablePassThroughMetadata factory = context.createMetadata(MutablePassThroughMetadata.class);
factory.setId(".camelBlueprint.passThrough." + id);
factory.setObject(new PassThroughCallable<Object>(scpfb));
MutableBeanMetadata factory2 = context.createMetadata(MutableBeanMetadata.class);
factory2.setId(".camelBlueprint.factory." + id);
factory2.setFactoryComponent(factory);
factory2.setFactoryMethod("call");
factory2.setInitMethod("afterPropertiesSet");
factory2.setDestroyMethod("destroy");
factory2.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
MutableBeanMetadata ctx = context.createMetadata(MutableBeanMetadata.class);
ctx.setId(id);
ctx.setRuntimeClass(SSLContextParameters.class);
ctx.setFactoryComponent(factory2);
ctx.setFactoryMethod("getObject");
// must be lazy as we want CamelContext to be activated first
ctx.setActivation(ACTIVATION_LAZY);
LOG.trace("Parsing SSLContextParameters done, returning {}", ctx);
return ctx;
}
示例14: parseRouteContextNode
import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseRouteContextNode(Element element, ParserContext context) {
LOG.trace("Parsing RouteContext {}", element);
// now parse the routes with JAXB
Binder<Node> binder;
try {
binder = getJaxbContext().createBinder();
} catch (JAXBException e) {
throw new ComponentDefinitionException("Failed to create the JAXB binder : " + e, e);
}
Object value = parseUsingJaxb(element, context, binder);
if (!(value instanceof CamelRouteContextFactoryBean)) {
throw new ComponentDefinitionException("Expected an instance of " + CamelRouteContextFactoryBean.class);
}
CamelRouteContextFactoryBean rcfb = (CamelRouteContextFactoryBean) value;
String id = rcfb.getId();
MutablePassThroughMetadata factory = context.createMetadata(MutablePassThroughMetadata.class);
factory.setId(".camelBlueprint.passThrough." + id);
factory.setObject(new PassThroughCallable<Object>(rcfb));
MutableBeanMetadata factory2 = context.createMetadata(MutableBeanMetadata.class);
factory2.setId(".camelBlueprint.factory." + id);
factory2.setFactoryComponent(factory);
factory2.setFactoryMethod("call");
MutableBeanMetadata ctx = context.createMetadata(MutableBeanMetadata.class);
ctx.setId(id);
ctx.setRuntimeClass(List.class);
ctx.setFactoryComponent(factory2);
ctx.setFactoryMethod("getRoutes");
// must be lazy as we want CamelContext to be activated first
ctx.setActivation(ACTIVATION_LAZY);
// lets inject the namespaces into any namespace aware POJOs
injectNamespaces(element, binder);
LOG.trace("Parsing RouteContext done, returning {}", element, ctx);
return ctx;
}