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


Java Portlet类代码示例

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


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

示例1: afterPropertiesSet

import javax.portlet.Portlet; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
	if (this.portletClass == null) {
		throw new IllegalArgumentException("portletClass is required");
	}
	if (!Portlet.class.isAssignableFrom(this.portletClass)) {
		throw new IllegalArgumentException("portletClass [" + this.portletClass.getName() +
			"] needs to implement interface [javax.portlet.Portlet]");
	}
	if (this.portletName == null) {
		this.portletName = this.beanName;
	}
	PortletConfig config = this.portletConfig;
	if (config == null || !this.useSharedPortletConfig) {
		config = new DelegatingPortletConfig();
	}
	this.portletInstance = (Portlet) this.portletClass.newInstance();
	this.portletInstance.init(config);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:20,代码来源:PortletWrappingController.java

示例2: postProcessAfterInitialization

import javax.portlet.Portlet; //导入依赖的package包/类
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
	if (bean instanceof Portlet) {
		PortletConfig config = this.portletConfig;
		if (config == null || !this.useSharedPortletConfig) {
			config = new DelegatingPortletConfig(beanName, this.portletContext, this.portletConfig);
		}
		try {
			((Portlet) bean).init(config);
		}
		catch (PortletException ex) {
			throw new BeanInitializationException("Portlet.init threw exception", ex);
		}
	}
	return bean;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:17,代码来源:SimplePortletPostProcessor.java

示例3: afterPropertiesSet

import javax.portlet.Portlet; //导入依赖的package包/类
public void afterPropertiesSet() throws Exception {
	if (this.portletClass == null) {
		throw new IllegalArgumentException("portletClass is required");
	}
	if (!Portlet.class.isAssignableFrom(this.portletClass)) {
		throw new IllegalArgumentException("portletClass [" + this.portletClass.getName() +
			"] needs to implement interface [javax.portlet.Portlet]");
	}
	if (this.portletName == null) {
		this.portletName = this.beanName;
	}
	PortletConfig config = this.portletConfig;
	if (config == null || !this.useSharedPortletConfig) {
		config = new DelegatingPortletConfig();
	}
	this.portletInstance = (Portlet) this.portletClass.newInstance();
	this.portletInstance.init(config);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:19,代码来源:PortletWrappingController.java

示例4: beanMgrTest

import javax.portlet.Portlet; //导入依赖的package包/类
@Test
public void beanMgrTest() throws Exception {
   assertNotNull(bm);
   
   Set<Bean<?>> beans = bm.getBeans(TestPortlet1.class);
   Bean<?> bean = bm.resolve(beans);
   assertNotNull(bean);
   
   CreationalContext<?> coco = bm.createCreationalContext(bean);
   assertNotNull(coco);
   
   Object obj = bm.getReference(bean, TestPortlet1.class, coco);
   assertNotNull(obj);
   assertTrue(obj instanceof GenericPortlet);
   assertTrue(obj instanceof Portlet);
   assertTrue(obj instanceof HeaderPortlet);
   assertTrue(obj instanceof EventPortlet);
   assertTrue(obj instanceof ResourceServingPortlet);
   
   Object obj2 = bm.getReference(bean, TestPortlet1.class, coco);
   assertNotNull(obj2);
   assertFalse(obj.equals(obj2));
   assertFalse(obj == obj2);
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:25,代码来源:CDIPrototyping.java

示例5: appScopedTest

import javax.portlet.Portlet; //导入依赖的package包/类
@Test
public void appScopedTest() throws Exception {
   assertNotNull(bm);
   
   Set<Bean<?>> beans = bm.getBeans(TestPortlet1AppScoped.class);
   Bean<?> bean = bm.resolve(beans);
   assertNotNull(bean);
   
   CreationalContext<?> coco = bm.createCreationalContext(bean);
   assertNotNull(coco);
   
   Object obj = bm.getReference(bean, TestPortlet1AppScoped.class, coco);
   assertNotNull(obj);
   assertTrue(obj instanceof GenericPortlet);
   assertTrue(obj instanceof Portlet);
   assertTrue(obj instanceof HeaderPortlet);
   assertTrue(obj instanceof EventPortlet);
   assertTrue(obj instanceof ResourceServingPortlet);
   
   Object obj2 = bm.getReference(bean, TestPortlet1AppScoped.class, coco);
   assertNotNull(obj2);
   assertTrue(obj.equals(obj2));
   assertTrue(obj == obj2);
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:25,代码来源:CDIPrototyping.java

示例6: handleRender

import javax.portlet.Portlet; //导入依赖的package包/类
@Override
public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler)
		throws Exception {

	((Portlet) handler).render(request, response);
	return null;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:SimplePortletHandlerAdapter.java

示例7: init

import javax.portlet.Portlet; //导入依赖的package包/类
@Override
public void init(PortletConfig portletConfig) throws PortletException {
	super.init(portletConfig);

	LiferayPortletConfig liferayPortletConfig =
		(LiferayPortletConfig)portletConfig;

	com.liferay.portal.kernel.model.Portlet portlet =
		liferayPortletConfig.getPortlet();

	PortletApp portletApp = portlet.getPortletApp();

	ServletContextPool.put(
		portletApp.getServletContextName(), portletApp.getServletContext());
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:16,代码来源:ControlPanelPortlet.java

示例8: start

import javax.portlet.Portlet; //导入依赖的package包/类
@Override
public void start(BundleContext bundleContext) throws Exception {
	Dictionary<String, Object> properties = new Hashtable<>();

	properties.put(
		"com.liferay.portlet.display-category", "category.sample");
	properties.put("com.liferay.portlet.instanceable", "true");
	properties.put("javax.portlet.display-name", "OSGi API Portlet");
	properties.put(
		"javax.portlet.security-role-ref",
		new String[] {"power-user", "user"});

	_serviceRegistration = bundleContext.registerService(
		Portlet.class, new OSGiAPIPortlet(), properties);
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:16,代码来源:Activator.java

示例9: postProcessAfterInitialization

import javax.portlet.Portlet; //导入依赖的package包/类
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
	if (bean instanceof Portlet) {
		PortletConfig config = this.portletConfig;
		if (config == null || !this.useSharedPortletConfig) {
			config = new DelegatingPortletConfig(beanName, this.portletContext, this.portletConfig);
		}
		try {
			((Portlet) bean).init(config);
		}
		catch (PortletException ex) {
			throw new BeanInitializationException("Portlet.init threw exception", ex);
		}
	}
	return bean;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:16,代码来源:SimplePortletPostProcessor.java

示例10: start

import javax.portlet.Portlet; //导入依赖的package包/类
@Override
public void start() throws Exception {
  if (Vertx.currentContext().config().getBoolean("loaded_globally")) {
    if (Portlet.class.getClassLoader() == MyVerticle.class.getClassLoader()) {
      throw new Exception("System dependency not loaded by the correct loader");
    }
  } else {
    if (Portlet.class.getClassLoader() != MyVerticle.class.getClassLoader()) {
      throw new Exception("System dependency not loaded by the correct loader");
    }
  }
}
 
开发者ID:vert-x3,项目名称:vertx-maven-service-factory,代码行数:13,代码来源:MyVerticle.java

示例11: appScopedTest2Coco

import javax.portlet.Portlet; //导入依赖的package包/类
@Test
public void appScopedTest2Coco() throws Exception {
   assertNotNull(bm);
   
   Set<Bean<?>> beans = bm.getBeans(TestPortlet1AppScoped.class);
   Bean<?> bean = bm.resolve(beans);
   assertNotNull(bean);
   
   CreationalContext<?> coco1 = bm.createCreationalContext(bean);
   assertNotNull(coco1);
   
   Object obj = bm.getReference(bean, TestPortlet1AppScoped.class, coco1);
   assertNotNull(obj);
   assertTrue(obj instanceof GenericPortlet);
   assertTrue(obj instanceof Portlet);
   assertTrue(obj instanceof HeaderPortlet);
   assertTrue(obj instanceof EventPortlet);
   assertTrue(obj instanceof ResourceServingPortlet);
   
   CreationalContext<?> coco2 = bm.createCreationalContext(bean);
   assertNotNull(coco2);
   
   Object obj2 = bm.getReference(bean, TestPortlet1AppScoped.class, coco2);
   assertNotNull(obj2);
   assertTrue(obj.equals(obj2));
   assertTrue(obj == obj2);
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:28,代码来源:CDIPrototyping.java

示例12: appScopedTest2Coco2Bean

import javax.portlet.Portlet; //导入依赖的package包/类
@Test
public void appScopedTest2Coco2Bean() throws Exception {
   assertNotNull(bm);
   
   Set<Bean<?>> beans1 = bm.getBeans(TestPortlet1AppScoped.class);
   Bean<?> bean1 = bm.resolve(beans1);
   assertNotNull(bean1);
   
   CreationalContext<?> coco1 = bm.createCreationalContext(bean1);
   assertNotNull(coco1);
   
   Object obj = bm.getReference(bean1, TestPortlet1AppScoped.class, coco1);
   assertNotNull(obj);
   assertTrue(obj instanceof GenericPortlet);
   assertTrue(obj instanceof Portlet);
   assertTrue(obj instanceof HeaderPortlet);
   assertTrue(obj instanceof EventPortlet);
   assertTrue(obj instanceof ResourceServingPortlet);
   
   Set<Bean<?>> beans2 = bm.getBeans(TestPortlet1AppScoped.class);
   Bean<?> bean2 = bm.resolve(beans2);
   assertNotNull(bean2);
   
   CreationalContext<?> coco2 = bm.createCreationalContext(bean2);
   assertNotNull(coco2);
   
   Object obj2 = bm.getReference(bean2, TestPortlet1AppScoped.class, coco2);
   assertNotNull(obj2);
   assertTrue(obj.equals(obj2));
   assertTrue(obj == obj2);
   
   assertEquals(bean1, bean2);
   assertNotEquals(coco1, coco2);
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:35,代码来源:CDIPrototyping.java

示例13: processFilter

import javax.portlet.Portlet; //导入依赖的package包/类
public void processFilter(ActionRequest req, ActionResponse res, Portlet portlet, PortletContext portletContext)
      throws IOException, PortletException {
   this.portlet = portlet;
   this.loader = Thread.currentThread().getContextClassLoader();
   this.portletContext = portletContext;
   doFilter(req, res);
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:8,代码来源:FilterChainImpl.java

示例14: invokePostInit

import javax.portlet.Portlet; //导入依赖的package包/类
public void invokePostInit(HttpServletRequest request) throws IllegalArgumentException, IllegalStateException {
    PortletsSetupModule portletsSetupModule = getProcessedPortletsSetupModule();
    Portlet portlet = getPortletForModule(portletsSetupModule);
    try {
        portletsSetupModule.invokePostInit(request, portlet);
    } catch (IllegalArgumentException e) {
        throw new IllegalArgumentException(portletsSetupModule.getModuleError(e.getMessage(),request.getLocale()));
    }
    if(portletsSetupModule.isPostInitPhaseProcessed() && postInitPortletsSetupModules.isEmpty()){
        setPostInitSetupDone();
    }
}
 
开发者ID:brandt,项目名称:GridSphere,代码行数:13,代码来源:PortletsSetupModuleServiceImpl.java

示例15: getPortletForModule

import javax.portlet.Portlet; //导入依赖的package包/类
private Portlet getPortletForModule(PortletsSetupModule portletsSetupModule){
    Portlet portlet = null;
    String contextName = portletsSetupModule.getContextName();
    String portletName = portletsSetupModule.getPortletName();
    if(null != portletName && !"".equals(portletName))
        portlet = portlets.get(contextName).get(portletName);
    return portlet;
}
 
开发者ID:brandt,项目名称:GridSphere,代码行数:9,代码来源:PortletsSetupModuleServiceImpl.java


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