• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java InvalidTargetObjectTypeException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.management.modelmbean.InvalidTargetObjectTypeException的典型用法代码示例。如果您正苦于以下问题:Java InvalidTargetObjectTypeException类的具体用法?Java InvalidTargetObjectTypeException怎么用?Java InvalidTargetObjectTypeException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InvalidTargetObjectTypeException类属于javax.management.modelmbean包,在下文中一共展示了InvalidTargetObjectTypeException类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: resolveTargetObject

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
private Object resolveTargetObject(Descriptor descriptor) throws MBeanException {
  Logger logger = getLogger();
  Object target = descriptor.getFieldValue("targetObject");
  if (logger.isEnabledFor(Logger.TRACE))
    logger.trace("targetObject is: " + target);
  if (target == null) {
    target = getManagedResource();
  } else {
    String targetObjectType = (String) descriptor.getFieldValue("targetObjectType");
    if (logger.isEnabledFor(Logger.TRACE))
      logger.trace("targetObjectType is: " + targetObjectType);
    if (targetObjectType == null) {
      // Not defined, assume object reference
      targetObjectType = OBJECT_RESOURCE_TYPE;
    }

    if (!isResourceTypeSupported(targetObjectType))
      throw new MBeanException(new InvalidTargetObjectTypeException(targetObjectType));
  }
  return target;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:22,代码来源:MX4JModelMBean.java


示例2: resolveTargetObject

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
private Object resolveTargetObject(Descriptor descriptor) throws MBeanException
{
   Logger logger = getLogger();
   Object target = descriptor.getFieldValue("targetObject");
   if (logger.isEnabledFor(Logger.TRACE)) logger.trace("targetObject is: " + target);
   if (target == null)
   {
      target = getManagedResource();
   }
   else
   {
      String targetObjectType = (String)descriptor.getFieldValue("targetObjectType");
      if (logger.isEnabledFor(Logger.TRACE)) logger.trace("targetObjectType is: " + targetObjectType);
      if (targetObjectType == null)
      {
         // Not defined, assume object reference
         targetObjectType = OBJECT_RESOURCE_TYPE;
      }

      if (!isResourceTypeSupported(targetObjectType)) throw new MBeanException(new InvalidTargetObjectTypeException(targetObjectType));
   }
   return target;
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:24,代码来源:MX4JModelMBean.java


示例3: setManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
/**
 * Sets managed resource to expose and stores its {@link ClassLoader}.
 */
@Override
public void setManagedResource(Object managedResource, String managedResourceType)
		throws MBeanException, InstanceNotFoundException, InvalidTargetObjectTypeException {

	this.managedResourceClassLoader = managedResource.getClass().getClassLoader();
	super.setManagedResource(managedResource, managedResourceType);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:SpringModelMBean.java


示例4: getManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
/**
 * Get the instance handle of the object against which we execute
 * all methods in this ModelMBean management interface.
 *
 * @exception InstanceNotFoundException if the managed resource object
 *  cannot be found
 * @exception MBeanException if the initializer of the object throws
 *  an exception
 * @exception RuntimeOperationsException if the managed resource or the
 *  resource type is <code>null</code> or invalid
 */
public Object getManagedResource()
    throws InstanceNotFoundException, InvalidTargetObjectTypeException,
    MBeanException, RuntimeOperationsException {

    if (resource == null)
        throw new RuntimeOperationsException
            (new IllegalArgumentException("Managed resource is null"),
             "Managed resource is null");

    return resource;

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:BaseModelMBean.java


示例5: setManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
public void setManagedResource(Object resource, String resourceType) throws MBeanException,
    RuntimeOperationsException, InstanceNotFoundException, InvalidTargetObjectTypeException {
  if (resource == null)
    throw new RuntimeOperationsException(new IllegalArgumentException(
        LocalizedStrings.MX4JModelMBean_MANAGED_RESOURCE_CANNOT_BE_NULL.toLocalizedString()));
  if (!isResourceTypeSupported(resourceType))
    throw new InvalidTargetObjectTypeException(resourceType);

  Logger logger = getLogger();
  if (logger.isEnabledFor(Logger.DEBUG))
    logger.debug("Setting managed resource to be: " + resource);
  m_managedResource = resource;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:14,代码来源:MX4JModelMBean.java


示例6: setManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
public void setManagedResource(Object resource, String resourceType) throws MBeanException, RuntimeOperationsException, InstanceNotFoundException, InvalidTargetObjectTypeException
{
   if (resource == null) throw new RuntimeOperationsException(new IllegalArgumentException(LocalizedStrings.MX4JModelMBean_MANAGED_RESOURCE_CANNOT_BE_NULL.toLocalizedString()));
   if (!isResourceTypeSupported(resourceType)) throw new InvalidTargetObjectTypeException(resourceType);

   Logger logger = getLogger();
   if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Setting managed resource to be: " + resource);
   m_managedResource = resource;
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:10,代码来源:MX4JModelMBean.java


示例7: assemble

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
@Override
public ModelMBean assemble(Object obj, ObjectName name) throws JMException {
    ModelMBeanInfo mbi = null;

    // use the default provided mbean which has been annotated with JMX
    // annotations
    LOGGER.trace("Assembling MBeanInfo for: {} from @ManagedResource object: {}", name, obj);
    mbi = assembler.getMBeanInfo(obj, null, name.toString());

    if (mbi == null) {
        return null;
    }

    RequiredModelMBean mbean = new RequiredModelMBean(mbi);

    try {
        mbean.setManagedResource(obj, "ObjectReference");
    } catch (InvalidTargetObjectTypeException e) {
        throw new JMException(e.getMessage());
    }

    // Allows the managed object to send notifications
    if (obj instanceof NotificationSenderAware) {
        ((NotificationSenderAware) obj).setNotificationSender(new NotificationSenderAdapter(mbean));
    }

    return mbean;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:29,代码来源:DefaultManagementMBeanAssembler.java


示例8: HttpServerMBean

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
/** Constructor. 
 * @exception MBeanException 
 * @exception InstanceNotFoundException 
 */
protected HttpServerMBean(HttpServer httpServer)
    throws MBeanException, InstanceNotFoundException
{
    _httpServer=httpServer;
    _httpServer.addEventListener(this);
    try{super.setManagedResource(_httpServer,"objectReference");}
    catch(InvalidTargetObjectTypeException e){log.warn(LogSupport.EXCEPTION,e);}
}
 
开发者ID:epam,项目名称:Wilma,代码行数:13,代码来源:HttpServerMBean.java


示例9: setManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
public void setManagedResource(Object o,String s)
    throws MBeanException, InstanceNotFoundException, InvalidTargetObjectTypeException
{
    if (o!=null)
        ((HttpServer)o).addEventListener(this);
    super.setManagedResource(o,s);
}
 
开发者ID:epam,项目名称:Wilma,代码行数:8,代码来源:HttpServerMBean.java


示例10: getType

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
private Class<?> getType(Attributes attributes, String nomAttribut) throws ClassNotFoundException, InvalidTargetObjectTypeException {
	Class<?> typeToUnmarshall;
	String typeEcrit = attributes.getValue("type");
	if(typeEcrit != null){
		typeToUnmarshall = getTypeDepuisNom(attributes.getValue("type"));
		if(isFirst) 
			checkType(typeToUnmarshall);
	}else{
		typeToUnmarshall = getType(nomAttribut);
	}
	return typeToUnmarshall;
}
 
开发者ID:giraudsa,项目名称:serialisation,代码行数:13,代码来源:XmlUnmarshaller.java


示例11: checkType

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <T> void checkType(Class<T> typeToUnmarshall) throws InvalidTargetObjectTypeException {
	try {
		U test = (U) createInstance(typeToUnmarshall);
		test.getClass();
	} catch (Exception e) {
		LOGGER.error("le type attendu n'est pas celui du XML ou n'est pas instanciable", e);
		throw new InvalidTargetObjectTypeException(e, "not instanciable from " + typeToUnmarshall.getName());
	}
}
 
开发者ID:giraudsa,项目名称:serialisation,代码行数:11,代码来源:XmlUnmarshaller.java


示例12: startElement

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
protected void startElement(String qName, Attributes attributes) throws ClassNotFoundException, NotImplementedSerializeException, InvalidTargetObjectTypeException, InstanciationException, EntityManagerImplementationException{
	setCache(attributes);
	Class<?> type = getType(attributes, qName);
	isFirst = false;
	if(type != null){
		ActionXml<?> action = (ActionXml<?>) getAction(type);
		setNom(action, qName);
		setFieldInformation(action);
		setId(attributes, action);
		pileAction.push(action);
	}
}
 
开发者ID:giraudsa,项目名称:serialisation,代码行数:13,代码来源:XmlUnmarshaller.java


示例13: assemble

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
public ModelMBean assemble(MBeanServer mBeanServer, Object obj, ObjectName name) throws JMException {
    ModelMBeanInfo mbi = null;

    // prefer to use the managed instance if it has been annotated with Spring JMX annotations
    if (obj instanceof ManagedInstance) {
        Object custom = ((ManagedInstance) obj).getInstance();
        if (custom != null && ObjectHelper.hasAnnotation(custom.getClass().getAnnotations(), ManagedResource.class)) {
            LOG.trace("Assembling MBeanInfo for: {} from custom @ManagedResource object: {}", name, custom);
            // get the mbean info from the custom managed object
            mbi = springAssembler.getMBeanInfo(custom, name.toString());
            // and let the custom object be registered in JMX
            obj = custom;
        }
    }

    if (mbi == null) {
        if (ObjectHelper.hasAnnotation(obj.getClass().getAnnotations(), ManagedResource.class)) {
            // the object has a Spring ManagedResource annotations so assemble the MBeanInfo
            LOG.trace("Assembling MBeanInfo for: {} from @ManagedResource object: {}", name, obj);
            mbi = springAssembler.getMBeanInfo(obj, name.toString());
        } else {
            // fallback and let the default mbean assembler handle this instead
            return super.assemble(mBeanServer, obj, name);
        }
    }

    LOG.trace("Assembled MBeanInfo {}", mbi);

    RequiredModelMBean mbean = (RequiredModelMBean) mBeanServer.instantiate(RequiredModelMBean.class.getName());
    mbean.setModelMBeanInfo(mbi);

    try {
        mbean.setManagedResource(obj, "ObjectReference");
    } catch (InvalidTargetObjectTypeException e) {
        throw new JMException(e.getMessage());
    }

    // Allows the managed object to send notifications
    if (obj instanceof NotificationSenderAware) {
        ((NotificationSenderAware)obj).setNotificationSender(new NotificationSenderAdapter(mbean));
    }

    return mbean;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:45,代码来源:SpringManagementMBeanAssembler.java


示例14: JmxBuilderModelMBean

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
public JmxBuilderModelMBean(Object objectRef) throws MBeanException, RuntimeOperationsException, InstanceNotFoundException, InvalidTargetObjectTypeException {
    super.setManagedResource(objectRef, "ObjectReference");
}
 
开发者ID:apache,项目名称:groovy,代码行数:4,代码来源:JmxBuilderModelMBean.java


示例15: setManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
@Override
public void setManagedResource(Object mr, String mr_type) throws MBeanException, RuntimeOperationsException,
        InstanceNotFoundException, InvalidTargetObjectTypeException {
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:5,代码来源:TestModelMBean.java


示例16: getManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
/**
 * Get the instance handle of the object against which we execute
 * all methods in this ModelMBean management interface.
 *
 * @exception InstanceNotFoundException if the managed resource object
 *  cannot be found
 * @exception InvalidTargetObjectTypeException if the managed resource
 *  object is of the wrong type
 * @exception MBeanException if the initializer of the object throws
 *  an exception
 * @exception RuntimeOperationsException if the managed resource or the
 *  resource type is <code>null</code> or invalid
 */
public Object getManagedResource()
    throws InstanceNotFoundException, InvalidTargetObjectTypeException,
    MBeanException, RuntimeOperationsException {

    if (resource == null)
        throw new RuntimeOperationsException
            (new IllegalArgumentException("Managed resource is null"),
             "Managed resource is null");

    return resource;

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:26,代码来源:BaseModelMBean.java


示例17: getManagedResource

import javax.management.modelmbean.InvalidTargetObjectTypeException; //导入依赖的package包/类
/**
 * Get the instance handle of the object against which we execute all
 * methods in this ModelMBean management interface.
 *
 * @exception InstanceNotFoundException
 *                if the managed resource object cannot be found
 * @exception InvalidTargetObjectTypeException
 *                if the managed resource object is of the wrong type
 * @exception MBeanException
 *                if the initializer of the object throws an exception
 * @exception RuntimeOperationsException
 *                if the managed resource or the resource type is
 *                <code>null</code> or invalid
 */
public Object getManagedResource() throws InstanceNotFoundException, InvalidTargetObjectTypeException,
		MBeanException, RuntimeOperationsException {

	if (resource == null)
		throw new RuntimeOperationsException(new IllegalArgumentException("Managed resource is null"),
				"Managed resource is null");

	return resource;

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:25,代码来源:BaseModelMBean.java



注:本文中的javax.management.modelmbean.InvalidTargetObjectTypeException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataContentHandler类代码示例发布时间:2022-05-21
下一篇:
Java JobStatus类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap