Hi Jared,
Well, Shiro must be initialized at a bundle activator method or at any service initialization one, if you are using DS or Blueprint for example. So, If you are using a OSGi without web Layer, there are any problem. It is like any other Shiro initialization for common java programs.

The problem here is that my application is a hybrid one, it was born as a OSGi headless application and the WEB layer was added after that... and this is why we use the shiro-web.

regards

On 20/01/12 17:01, Jared Bunting wrote:
I'd also be interested in if there is a more osgi-ish way to do this.
My unfamiliarity with OSGI is limiting me here, but I'm curious if
something like a "bundle activator" (mentioned in the parallel thread
by atomicknight) would be a more appropriate way to go.  If it is, I
don't see any reason that we can't add this sort of integration to
Shiro.

-Jared

On Fri 20 Jan 2012 01:44:02 PM CST, Les Hazlewood wrote:
If it is any consolation, the IniShiroFilter, while deprecated, won't
be actually deleted until Shiro 2.x, which I'm sure is a long way
away.  You can continue using the IniShiroFilter until you have the
opportunity to create the bridge code.

Or, if you like, feel free to create a Jira issue for an improvement -
it would be extremely easy to create a subclass of ShiroFilter that
initializes the necessary WebEnvironment at filter startup.  If you
can't use a servlet context listener, this would be the next best
thing and would work as expected.  The EnvironmentLoaderListener is
extremely minimal on purpose - the real work is done in the parent
class, which can be used from a Filter easily.

The only downside of this approach is that other components that might
need to access Shiro objects couldn't do so until the filter was
initialized.  This is why the listener approach is better.  But it
would still be the best available solution for non-listener
environments.

Feel free to open an issue and we can see about getting it in to 1.3.

HTH,

Les

On Fri, Jan 20, 2012 at 3:36 AM, Cristiano Gavião<[email protected]>  wrote:
Hi,

Unfortunately not, without have to create some bridged code. Just because we
are stuck in some old servlet api that do not supply a way to register a
listener that is mandatory in the now-default ShiroFilter.

regards

Cristiano


On 19/01/12 19:01, Les Hazlewood wrote:
The same effect can be achieved using the now-default ShiroFilter and
register it as you would any other filter.  Is this not possible?

On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião<[email protected]>
  wrote:
Shiro dev guys,

I'm sent this mail to ask about the deprecation of
org.apache.shiro.web.servlet.IniShiroFilter.

As I try to explain in the user list, the OSGi Spec for HTTP does not
provide a way to register Filter neither Listeners.

But the HTTP API provided by both of the most used osgi containers
(Equinox
and Felix) provides a way to register Filters, but lacks a way to
register
Listeners.

Don't know when this can happen, actually. People from IBM told me that
maaaaybe it could happen in next version of the OSGi Spec.

So, I would like to ask to the Shiro team to review such deprecation for
now.

regards,

Cristiano


Reply via email to