@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);
}
java类javax.portlet.Portlet的实例源码
PortletWrappingController.java 文件源码
项目:spring4-understanding
阅读 21
收藏 0
点赞 0
评论 0
SimplePortletPostProcessor.java 文件源码
项目:spring4-understanding
阅读 19
收藏 0
点赞 0
评论 0
@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;
}
PortletWrappingController.java 文件源码
项目:class-guard
阅读 22
收藏 0
点赞 0
评论 0
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);
}
CDIPrototyping.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
@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);
}
CDIPrototyping.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
@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);
}
SimplePortletHandlerAdapter.java 文件源码
项目:spring4-understanding
阅读 20
收藏 0
点赞 0
评论 0
@Override
public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler)
throws Exception {
((Portlet) handler).render(request, response);
return null;
}
ControlPanelPortlet.java 文件源码
项目:liferay-blade-samples
阅读 18
收藏 0
点赞 0
评论 0
@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());
}
Activator.java 文件源码
项目:liferay-blade-samples
阅读 17
收藏 0
点赞 0
评论 0
@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);
}
ControlPanelPortlet.java 文件源码
项目:liferay-blade-samples
阅读 19
收藏 0
点赞 0
评论 0
@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());
}
Activator.java 文件源码
项目:liferay-blade-samples
阅读 20
收藏 0
点赞 0
评论 0
@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);
}
ControlPanelPortlet.java 文件源码
项目:liferay-blade-samples
阅读 21
收藏 0
点赞 0
评论 0
@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());
}
Activator.java 文件源码
项目:liferay-blade-samples
阅读 25
收藏 0
点赞 0
评论 0
@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);
}
SimplePortletPostProcessor.java 文件源码
项目:class-guard
阅读 22
收藏 0
点赞 0
评论 0
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;
}
MyVerticle.java 文件源码
项目:vertx-maven-service-factory
阅读 17
收藏 0
点赞 0
评论 0
@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");
}
}
}
CDIPrototyping.java 文件源码
项目:portals-pluto
阅读 18
收藏 0
点赞 0
评论 0
@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);
}
CDIPrototyping.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
@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);
}
FilterChainImpl.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
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);
}
FilterChainImpl.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
public void processFilter(RenderRequest req, RenderResponse res, Portlet portlet, PortletContext portletContext)
throws IOException, PortletException {
this.portlet = portlet;
this.loader = Thread.currentThread().getContextClassLoader();
this.portletContext = portletContext;
doFilter(req, res);
}
PortletsSetupModuleServiceImpl.java 文件源码
项目:GridSphere
阅读 44
收藏 0
点赞 0
评论 0
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();
}
}
PortletsSetupModuleServiceImpl.java 文件源码
项目:GridSphere
阅读 17
收藏 0
点赞 0
评论 0
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;
}
SimplePortletHandlerAdapter.java 文件源码
项目:spring4-understanding
阅读 19
收藏 0
点赞 0
评论 0
@Override
public boolean supports(Object handler) {
return (handler instanceof Portlet);
}
SimplePortletHandlerAdapter.java 文件源码
项目:spring4-understanding
阅读 18
收藏 0
点赞 0
评论 0
@Override
public void handleAction(ActionRequest request, ActionResponse response, Object handler)
throws Exception {
((Portlet) handler).processAction(request, response);
}
SimplePortletPostProcessor.java 文件源码
项目:spring4-understanding
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
if (bean instanceof Portlet) {
((Portlet) bean).destroy();
}
}
SimplePortletHandlerAdapter.java 文件源码
项目:class-guard
阅读 18
收藏 0
点赞 0
评论 0
public boolean supports(Object handler) {
return (handler instanceof Portlet);
}
SimplePortletHandlerAdapter.java 文件源码
项目:class-guard
阅读 18
收藏 0
点赞 0
评论 0
public void handleAction(ActionRequest request, ActionResponse response, Object handler)
throws Exception {
((Portlet) handler).processAction(request, response);
}
SimplePortletHandlerAdapter.java 文件源码
项目:class-guard
阅读 18
收藏 0
点赞 0
评论 0
public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler)
throws Exception {
((Portlet) handler).render(request, response);
return null;
}
SimplePortletPostProcessor.java 文件源码
项目:class-guard
阅读 20
收藏 0
点赞 0
评论 0
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
if (bean instanceof Portlet) {
((Portlet) bean).destroy();
}
}
FilterManagerImpl.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
/**
* @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.RenderRequest, javax.portlet.RenderResponse, javax.portlet.Portlet, javax.portlet.PortletContext)
*/
@Override
public void processFilter(RenderRequest req, RenderResponse res, Portlet portlet,PortletContext portletContext) throws PortletException, IOException{
filterchain.processFilter(req, res, portlet, portletContext);
}
FilterManagerImpl.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
/**
* @see org.apache.pluto.container.FilterManager#processFilter(javax.portlet.ActionRequest, javax.portlet.ActionResponse, javax.portlet.Portlet, javax.portlet.PortletContext)
*/
@Override
public void processFilter(ActionRequest req, ActionResponse res, Portlet portlet,PortletContext portletContext) throws PortletException, IOException{
filterchain.processFilter(req, res, portlet, portletContext);
}
ApplicationPortletImpl.java 文件源码
项目:GridSphere
阅读 18
收藏 0
点赞 0
评论 0
public Portlet getPortletInstance() {
return portletInstance;
}