当前位置: 首页>>代码示例>>Java>>正文


Java Loader类代码示例

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


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

示例1: createMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Create, register, and return an MBean for this
 * <code>Loader</code> object.
 *
 * @param loader The Loader to be managed
 *
 * @exception Exception if an MBean cannot be created or registered
 *
 * @deprecated Unused. Will be removed in Tomcat 8.0.x
 */
@Deprecated
static DynamicMBean createMBean(Loader loader)
    throws Exception {

    String mname = createManagedName(loader);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        Exception e = new Exception("ManagedBean is not found with "+mname);
        throw new MBeanException(e);
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    DynamicMBean mbean = managed.createMBean(loader);
    ObjectName oname = createObjectName(domain, loader);
    if( mserver.isRegistered( oname ))  {
        // side effect: stop it
        mserver.unregisterMBean( oname );
    }
    mserver.registerMBean(mbean, oname);
    return (mbean);

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

示例2: destroyMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Loader</code> object.
 *
 * @param loader The Loader to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 * @deprecated  Unused. Will be removed in Tomcat 8.0.x
 */
@Deprecated
static void destroyMBean(Loader loader)
    throws Exception {

    String mname = createManagedName(loader);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, loader);
    if( mserver.isRegistered(oname) )
        mserver.unregisterMBean(oname);

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

示例3: createMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Create, register, and return an MBean for this
 * <code>Loader</code> object.
 *
 * @param loader The Loader to be managed
 *
 * @exception Exception if an MBean cannot be created or registered
 */
static DynamicMBean createMBean(Loader loader)
    throws Exception {

    String mname = createManagedName(loader);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        Exception e = new Exception("ManagedBean is not found with "+mname);
        throw new MBeanException(e);
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    DynamicMBean mbean = managed.createMBean(loader);
    ObjectName oname = createObjectName(domain, loader);
    if( mserver.isRegistered( oname ))  {
        // side effect: stop it
        mserver.unregisterMBean( oname );
    }
    mserver.registerMBean(mbean, oname);
    return (mbean);

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

示例4: destroyMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Loader</code> object.
 *
 * @param loader The Loader to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 */
static void destroyMBean(Loader loader)
    throws Exception {

    String mname = createManagedName(loader);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, loader);
    if( mserver.isRegistered(oname) )
        mserver.unregisterMBean(oname);

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

示例5: begin

import org.apache.catalina.Loader; //导入依赖的package包/类
public void begin(Attributes attributes) throws Exception {

        // Look up the required parent class loader
        Container container = (Container) digester.peek();
        ClassLoader parentClassLoader = container.getParentClassLoader();

        // Instantiate a new Loader implementation object
        String className = loaderClass;
        if (attributeName != null) {
            String value = attributes.getValue(attributeName);
            if (value != null)
                className = value;
        }
        Class clazz = Class.forName(className);
        Class types[] = { ClassLoader.class };
        Object args[] = { parentClassLoader };
        Constructor constructor = clazz.getDeclaredConstructor(types);
        Loader loader = (Loader) constructor.newInstance(args);

        // Push the new loader onto the stack
        digester.push(loader);
        if (digester.getDebug() >= 1)
            digester.log("new " + loader.getClass().getName());

    }
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:26,代码来源:ContextRuleSet.java

示例6: createMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Create, register, and return an MBean for this
 * <code>Loader</code> object.
 *
 * @param loader The Loader to be managed
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public static ModelMBean createMBean(Loader loader)
    throws Exception {

    String mname = createManagedName(loader);     
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        Exception e = new Exception("ManagedBean is not found with "+mname);
        throw new MBeanException(e);
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ModelMBean mbean = managed.createMBean(loader);
    ObjectName oname = createObjectName(domain, loader);
    mserver.registerMBean(mbean, oname);
    return (mbean);       
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:26,代码来源:MBeanUtils.java

示例7: destroyMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Loader</code> object.
 *
 * @param loader The Loader to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 */
public static void destroyMBean(Loader loader)
    throws Exception {

    String mname = createManagedName(loader);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, loader);
    mserver.unregisterMBean(oname);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:24,代码来源:MBeanUtils.java

示例8: isDefaultLoader

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Is this an instance of the default <code>Loader</code> configuration,
 * with all-default properties?
 *
 * @param loader Loader to be tested
 */
private boolean isDefaultLoader(Loader loader) {

    if (!(loader instanceof WebappLoader)) {
        return (false);
    }
    WebappLoader wloader = (WebappLoader) loader;
    if ((wloader.getCheckInterval() != 15) ||
        (wloader.getDebug() != 0) ||
        (wloader.getDelegate() != false) ||
        !wloader.getLoaderClass().equals
         ("org.apache.catalina.loader.WebappClassLoader")) {
        return (false);
    }
    return (true);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:23,代码来源:StandardServer.java

示例9: initializeSerializer

import org.apache.catalina.Loader; //导入依赖的package包/类
private void initializeSerializer() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
   log.info("Attempting to use serializer :" + serializationStrategyClass);
   serializer = (Serializer) Class.forName(serializationStrategyClass).newInstance();

   Loader loader = null;
   
   /* 默认支持tomcat7.x
   if (getContainer() != null) {
     loader = getContainer().getLoader();
   }
   */
   
   // 修改为支持tomcat8.x
   Context context = this.getContext();
   
   if (context != null) {
	loader = context.getLoader();
}

   ClassLoader classLoader = null;

   if (loader != null) {
     classLoader = loader.getClassLoader();
   }
   serializer.setClassLoader(classLoader);
 }
 
开发者ID:ctchengt,项目名称:tomcat8-redis-session-manager,代码行数:27,代码来源:RedisSessionManager.java

示例10: initializeSerializer

import org.apache.catalina.Loader; //导入依赖的package包/类
void initializeSerializer() throws ReflectiveOperationException {
	log.info("Attempting to use serializer :" + serializationStrategyClass);
	serializer = (Serializer) Class.forName(serializationStrategyClass).newInstance();

	Loader loader = null;

	if (getContext() != null) {
		loader = getContext().getLoader();
	}

	ClassLoader classLoader = null;

	if (loader != null) {
		classLoader = loader.getClassLoader();
	}
	serializer.setClassLoader(classLoader);
}
 
开发者ID:appNG,项目名称:appng-tomcat-session,代码行数:18,代码来源:RedisSessionManager.java

示例11: createMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Create, register, and return an MBean for this <code>Loader</code>
 * object.
 *
 * @param loader
 *            The Loader to be managed
 *
 * @exception Exception
 *                if an MBean cannot be created or registered
 *
 * @deprecated Unused. Will be removed in Tomcat 8.0.x
 */
@Deprecated
static DynamicMBean createMBean(Loader loader) throws Exception {

	String mname = createManagedName(loader);
	ManagedBean managed = registry.findManagedBean(mname);
	if (managed == null) {
		Exception e = new Exception("ManagedBean is not found with " + mname);
		throw new MBeanException(e);
	}
	String domain = managed.getDomain();
	if (domain == null)
		domain = mserver.getDefaultDomain();
	DynamicMBean mbean = managed.createMBean(loader);
	ObjectName oname = createObjectName(domain, loader);
	if (mserver.isRegistered(oname)) {
		// side effect: stop it
		mserver.unregisterMBean(oname);
	}
	mserver.registerMBean(mbean, oname);
	return (mbean);

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

示例12: destroyMBean

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Deregister the MBean for this <code>Loader</code> object.
 *
 * @param loader
 *            The Loader to be managed
 *
 * @exception Exception
 *                if an MBean cannot be deregistered
 * @deprecated Unused. Will be removed in Tomcat 8.0.x
 */
@Deprecated
static void destroyMBean(Loader loader) throws Exception {

	String mname = createManagedName(loader);
	ManagedBean managed = registry.findManagedBean(mname);
	if (managed == null) {
		return;
	}
	String domain = managed.getDomain();
	if (domain == null)
		domain = mserver.getDefaultDomain();
	ObjectName oname = createObjectName(domain, loader);
	if (mserver.isRegistered(oname))
		mserver.unregisterMBean(oname);

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

示例13: initializeSerializer

import org.apache.catalina.Loader; //导入依赖的package包/类
private void initializeSerializer() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
   log.info("Attempting to use serializer :" + serializationStrategyClass);
   serializer = (Serializer) Class.forName(serializationStrategyClass).newInstance();

   Loader loader = null;

   Context context = this.getContext();
if (context != null) {
	loader = context.getLoader();
}

   /*
    * if (getContainer() != null) {
     loader = getContainer().getLoader();
   }*/
   ClassLoader classLoader = null;

   if (loader != null) {
     classLoader = loader.getClassLoader();
   }
   serializer.setClassLoader(classLoader);
 }
 
开发者ID:xiaowing,项目名称:various_demos,代码行数:23,代码来源:RedisSessionManager.java

示例14: initializeSerializer

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * 初始化序列化
 * @throws ClassNotFoundException
 * @throws IllegalAccessException
 * @throws InstantiationException
 */
private void initializeSerializer() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
	log.info("Attempting to use serializer :" + serializationStrategyClass);
	serializer = (Serializer) Class.forName(serializationStrategyClass).newInstance();

	Loader loader = null;

	if (getContainer() != null) {
		loader = getContainer().getLoader();
	}

	ClassLoader classLoader = null;

	if (loader != null) {
		classLoader = loader.getClassLoader();
	}
	serializer.setClassLoader(classLoader);
}
 
开发者ID:liuxinglanyue,项目名称:distributed-session-manager,代码行数:24,代码来源:AbstractSessionManager.java

示例15: createObjectName

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * Create an <code>ObjectName</code> for this
 * <code>Loader</code> object.
 *
 * @param domain Domain in which this name is to be created
 * @param loader The Loader to be named
 *
 * @exception MalformedObjectNameException if a name cannot be created
 */
static ObjectName createObjectName(String domain,
                                          Loader loader)
    throws MalformedObjectNameException {

    ObjectName name = null;
    Container container = loader.getContainer();

    if (container instanceof Engine) {
        name = new ObjectName(domain + ":type=Loader");
    } else if (container instanceof Host) {
        name = new ObjectName(domain + ":type=Loader,host=" +
                          container.getName());
    } else if (container instanceof Context) {
        Context context = ((Context)container);
        ContextName cn = new ContextName(context.getName(), false);
        Container host = context.getParent();
        name = new ObjectName(domain + ":type=Loader,context=" +
                cn.getDisplayName() + ",host=" + host.getName());
    }

    return (name);

}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:33,代码来源:MBeanUtils.java


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