i'm realy new to GateIn and would like to know the way how to add a HttpFilter to a running!!! portal instance.
Code samples of the portal-extention with Filter/Servlets work only after restart the whole portal
or you get a Exception like this after deploying in running portal:
13:12:26,797 ERROR [[/sample-ext]] Exception sending context initialized event to listener instance of class org.exoplatform.container.web.PortalCon inerConfigOwner java.lang.IllegalStateException: No pre init tasks can be added to the portal container 'portal', because it has already been initialized. Check the ebapp 'sample-ext' at org.exoplatform.container.RootContainer$PortalContainerPreInitTask.onAlreadyExists(RootContainer.java:741) ...
My Problem is general. What can a developer change/add/edit/remove really dynamically without restarting gatein.
I think about developing modules of software I can deploy/undeploy every time I want without restarting gatein.
Sample: I deploy a web project with a filter and can redirect user
to a special page if they have a special GET parameter or a special Cookie in request.
Or I can deploy/undeploy a module with service in it. Service will be bound maybe as component, maybe in jndi context - so after it I can create a page with a new portlet(can be deployed dynamically every time) that can access the service/component to do some work.
How ist it possible ? What is the best way.
I see one possible way to do what you need (though i have not tested)
Implement a Startable object depending on ExtensibleFilter service component, then add FilterDefinition plugin into ExtensibleFilter in the start() method. The .war containing custom Startable is then hot-deployed