You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Ashish <pa...@gmail.com> on 2009/07/31 08:39:05 UTC

[Vysper] EhCache implementation - Some queries

Have implemented EhCache based LatestPresenceCache. Yet to test it.
Did some refactoring, added a Base Cache class etc. Not yet committed :-(

Have few queries
1. EhCache 1.6.1 (latest release) is not part of Central Maven repo's.
So question is, Can I use it? If not what's the way forward

2. Config file - What's the best place to put config file and use it
in code at runtime.

Essentially, the cache configuration is in the file, and I need to
refer to the file
while creating the cache. So how do I do it?

Need code something like CacheManager.createCache("config/ehcache.xml");

Any pointers?

-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Re: [Vysper] EhCache implementation - Some queries

Posted by Ashish <pa...@gmail.com>.
On Fri, Jul 31, 2009 at 12:45 PM, Niklas Gustavsson<ni...@protocol7.com> wrote:
> On Fri, Jul 31, 2009 at 8:39 AM, Ashish<pa...@gmail.com> wrote:
>> 1. EhCache 1.6.1 (latest release) is not part of Central Maven repo's.
>> So question is, Can I use it? If not what's the way forward
>
> Check with the EhCache developers if they can upload it. If they
> won't, or doesn't show any interest, request an upload yourself
> (http://maven.apache.org/guides/mini/guide-central-repository-upload.html).
> Until that's complete, I got a temporary Maven repo that we already
> use for Smack. If you send me the files (preferably with a complete
> POM, source and javadoc JARs offlist, I'll upload them.

They have hosted the stuff in their own repository (I missed this part)
http://oss.sonatype.org/content/repositories/sourceforge-releases/net/sf/ehcache/

Maven Central Repo's have the older versions.

Let me try and see if I can get it there

-- 
thanks
ashish

Re: [Vysper] EhCache implementation - Some queries

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Fri, Jul 31, 2009 at 8:39 AM, Ashish<pa...@gmail.com> wrote:
> 1. EhCache 1.6.1 (latest release) is not part of Central Maven repo's.
> So question is, Can I use it? If not what's the way forward

Check with the EhCache developers if they can upload it. If they
won't, or doesn't show any interest, request an upload yourself
(http://maven.apache.org/guides/mini/guide-central-repository-upload.html).
Until that's complete, I got a temporary Maven repo that we already
use for Smack. If you send me the files (preferably with a complete
POM, source and javadoc JARs offlist, I'll upload them.

/niklas

Re: [Vysper] EhCache implementation - Some queries

Posted by Ashish <pa...@gmail.com>.
On Sun, Aug 2, 2009 at 1:39 AM, Niklas Gustavsson<ni...@protocol7.com> wrote:
> On Sat, Aug 1, 2009 at 1:56 PM, Ashish<pa...@gmail.com> wrote:
>> Code committed. A quick review shall help. Also, please add this
>> (http://oss.sonatype.org/content/repositories/sourceforge-releases) to
>> your Maven repo's list
>
> I've added this to the parent POM. I also moved the complete
> dependency definition to the parent POM in line with our other
> dependencies. I also marked it as optional.

Thanks :-)

>
>> Also, do we need Licence information in ehcache.xml file as well?
>
> I would say so yes.
>
> /niklas
>



-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Re: [Vysper] EhCache implementation - Some queries

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Sat, Aug 1, 2009 at 1:56 PM, Ashish<pa...@gmail.com> wrote:
> Code committed. A quick review shall help. Also, please add this
> (http://oss.sonatype.org/content/repositories/sourceforge-releases) to
> your Maven repo's list

I've added this to the parent POM. I also moved the complete
dependency definition to the parent POM in line with our other
dependencies. I also marked it as optional.

> Also, do we need Licence information in ehcache.xml file as well?

I would say so yes.

/niklas

Re: [Vysper] EhCache implementation - Some queries

Posted by Ashish <pa...@gmail.com>.
Code committed. A quick review shall help. Also, please add this
(http://oss.sonatype.org/content/repositories/sourceforge-releases) to
your Maven repo's list

Have used two cache instances, one with Entity as key, and other JID as key.

Also, do we need Licence information in ehcache.xml file as well?

>
> Done :- )
> Its working. Will commit the changes tomorrow. Have to write couple of
> more test cases.
>
-- 
thanks
ashish

Re: [Vysper] EhCache implementation - Some queries

Posted by Ashish <pa...@gmail.com>.
On Fri, Jul 31, 2009 at 5:37 PM, Bernd
Fondermann<be...@googlemail.com> wrote:
> If you feel confident, refactor it to "resources".
>
> Bernd

Done :- )
Its working. Will commit the changes tomorrow. Have to write couple of
more test cases.

-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Re: [Vysper] EhCache implementation - Some queries

Posted by Bernd Fondermann <be...@googlemail.com>.
If you feel confident, refactor it to "resources".

Bernd

On 2009-07-31, Ashish <pa...@gmail.com> wrote:
>>> 2. Config file - What's the best place to put config file and use it
>>> in code at runtime.
>>
>> Please put it into src/main/config and put this directory on the
>> classpath when starting the server.
>> You should then be able to do:
>
> Hmm! Let me try. Will it work from the TestCase?
>
> Just checked MINA code, the config files have been kept in resources
> folder. See Chat example.
> Either ways, let me code and can find the exact place later.
>
> --
> thanks
> ashish
>
> Blog: http://www.ashishpaliwal.com/blog
> My Photo Galleries: http://www.pbase.com/ashishpaliwal
>

-- 
Sent from Google Mail for mobile | mobile.google.com

Re: [Vysper] EhCache implementation - Some queries

Posted by Ashish <pa...@gmail.com>.
>> 2. Config file - What's the best place to put config file and use it
>> in code at runtime.
>
> Please put it into src/main/config and put this directory on the
> classpath when starting the server.
> You should then be able to do:

Hmm! Let me try. Will it work from the TestCase?

Just checked MINA code, the config files have been kept in resources
folder. See Chat example.
Either ways, let me code and can find the exact place later.

-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Re: [Vysper] EhCache implementation - Some queries

Posted by Bernd Fondermann <be...@googlemail.com>.
Hi Ashish,

On Fri, Jul 31, 2009 at 08:39, Ashish<pa...@gmail.com> wrote:
> Have implemented EhCache based LatestPresenceCache. Yet to test it.

Great! :-)

> Did some refactoring, added a Base Cache class etc. Not yet committed :-(
>
> Have few queries
> 1. EhCache 1.6.1 (latest release) is not part of Central Maven repo's.
> So question is, Can I use it? If not what's the way forward
>
> 2. Config file - What's the best place to put config file and use it
> in code at runtime.

Please put it into src/main/config and put this directory on the
classpath when starting the server.
You should then be able to do:

  CacheManager.createCache("config/ehcache.xml");

>
> Essentially, the cache configuration is in the file, and I need to
> refer to the file
> while creating the cache. So how do I do it?
>
> Need code something like CacheManager.createCache("config/ehcache.xml");
>
> Any pointers?

HTH,

  Bernd

Re: [Vysper] EhCache implementation - Some queries

Posted by Jeff Genender <jg...@savoirtech.com>.
Then open a JIRA at Codehaus for Maven Repos and ask Jason if he would  
push it to central too.  He also is a good guy and usually will do  
that for you unless there are some nasty licensing issues.

Jeff


On Jul 31, 2009, at 7:47 AM, Ashish wrote:

> On Fri, Jul 31, 2009 at 6:56 PM, Jeff Genender<jg...@apache.org>  
> wrote:
>> Contact Greg Luck (the founder).  He is really nice and usually is  
>> pretty
>> responsive about getting ehcache into central.
>
> Thanks Jeff. Will definitely contact Greg.
>
> Anyways this is one interesting post from his blog
> http://gregluck.com/blog/archives/2009/05/anyone_with_a_p.html
>
> This explains why he is using the current repos
>
>> Jeff
>>
>>
> -- 
> thanks
> ashish


Re: [Vysper] EhCache implementation - Some queries

Posted by Ashish <pa...@gmail.com>.
On Fri, Jul 31, 2009 at 6:56 PM, Jeff Genender<jg...@apache.org> wrote:
> Contact Greg Luck (the founder).  He is really nice and usually is pretty
> responsive about getting ehcache into central.

Thanks Jeff. Will definitely contact Greg.

Anyways this is one interesting post from his blog
http://gregluck.com/blog/archives/2009/05/anyone_with_a_p.html

This explains why he is using the current repos

> Jeff
>
>
-- 
thanks
ashish

Re: [Vysper] EhCache implementation - Some queries

Posted by Jeff Genender <jg...@apache.org>.
Contact Greg Luck (the founder).  He is really nice and usually is  
pretty responsive about getting ehcache into central.

Jeff


On Jul 31, 2009, at 12:39 AM, Ashish wrote:

> Have implemented EhCache based LatestPresenceCache. Yet to test it.
> Did some refactoring, added a Base Cache class etc. Not yet  
> committed :-(
>
> Have few queries
> 1. EhCache 1.6.1 (latest release) is not part of Central Maven repo's.
> So question is, Can I use it? If not what's the way forward
>
> 2. Config file - What's the best place to put config file and use it
> in code at runtime.
>
> Essentially, the cache configuration is in the file, and I need to
> refer to the file
> while creating the cache. So how do I do it?
>
> Need code something like CacheManager.createCache("config/ 
> ehcache.xml");
>
> Any pointers?
>
> -- 
> thanks
> ashish
>
> Blog: http://www.ashishpaliwal.com/blog
> My Photo Galleries: http://www.pbase.com/ashishpaliwal