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

Java Loader类代码示例

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

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



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


示例16: 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());
        Container host = context.getParent();
        name = new ObjectName(domain + ":type=Loader,context=" +
                cn.getDisplayName() + ",host=" + host.getName());
    }

    return (name);

}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:33,代码来源:MBeanUtils.java


示例17: lazyClassLoader

import org.apache.catalina.Loader; //导入依赖的package包/类
private static TomEEWebappClassLoader lazyClassLoader(final org.apache.catalina.Context child) {
    if (child == null) {
        return null;
    }

    final Loader loader = child.getLoader();
    if (loader == null || !(loader instanceof LazyStopLoader)) {
        return null;
    }

    final ClassLoader old = ((LazyStopLoader) loader).getStopClassLoader();
    if (old == null || !(old instanceof TomEEWebappClassLoader)) {
        return null;
    }

    return (TomEEWebappClassLoader) old;
}
 
开发者ID:apache,项目名称:tomee,代码行数:18,代码来源:TomcatWebAppBuilder.java


示例18: destroy

import org.apache.catalina.Loader; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void destroy(final StandardContext standardContext) {
    final Loader standardContextLoader = standardContext.getLoader();
    if (LazyStopLoader.class.isInstance(standardContextLoader)) {
        final Loader delegate = LazyStopLoader.class.cast(standardContextLoader).getDelegateLoader();
        if (TomEEWebappLoader.class.isInstance(delegate)) {
            final TomEEWebappLoader webappLoader = TomEEWebappLoader.class.cast(delegate);
            final ClassLoader loader = webappLoader.internalLoader();
            webappLoader.clearLoader();
            if (TomEEWebappClassLoader.class.isInstance(loader)) {
                TomEEWebappClassLoader.class.cast(loader).internalDestroy();
            }
        }
    }

    final WebResourceRoot root = standardContext.getResources();
    if (LazyStopStandardRoot.class.isInstance(root)) {
        try {
            LazyStopStandardRoot.class.cast(root).internalDestroy();
        } catch (final LifecycleException e) {
            throw new IllegalStateException(e);
        }
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:28,代码来源:TomcatWebAppBuilder.java


示例19: getClassLoaders

import org.apache.catalina.Loader; //导入依赖的package包/类
public static ClassLoader[] getClassLoaders(Container container) {
    Loader loader = null;
    ClassLoader classLoader = null;
    if (container != null) loader = container.getLoader();
    if (loader != null) classLoader = loader.getClassLoader();
    else classLoader = Thread.currentThread().getContextClassLoader();
    if ( classLoader == Thread.currentThread().getContextClassLoader() ) {
        return new ClassLoader[] {classLoader};
    } else {
        return new ClassLoader[] {classLoader,Thread.currentThread().getContextClassLoader()};
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:ClusterManagerBase.java


示例20: getClassLoaders

import org.apache.catalina.Loader; //导入依赖的package包/类
public ClassLoader[] getClassLoaders() {
    Loader loader = null;
    ClassLoader classLoader = null;
    loader = this.getLoader();
    if (loader != null) classLoader = loader.getClassLoader();
    if ( classLoader == null ) classLoader = Thread.currentThread().getContextClassLoader();
    if ( classLoader == Thread.currentThread().getContextClassLoader() ) {
        return new ClassLoader[] {classLoader};
    } else {
        return new ClassLoader[] {classLoader,Thread.currentThread().getContextClassLoader()};
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:ReplicatedContext.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SshTransport类代码示例发布时间:2022-05-21
下一篇:
Java CameraUpdateFactory类代码示例发布时间: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