You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by sgjava <sg...@gmail.com> on 2015/11/30 20:10:34 UTC

JCS JCache replication

Can you configure the client and server on localhost with the same JCS
configuration file? I want this for an example, so it wouldn't be something
you'd normally do.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JCS JCache replication

Posted by Romain Manni-Bucau <rm...@gmail.com>.
there is a script as well:
https://github.com/apache/commons-jcs/blob/7f1ab60f7c1a30eb09cb06f23d6f010e3a187274/src/scripts/startRemoteCache.sh
(should be packaged in the full distribution even if I didnt check lately).

up to you to embedded it or not.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-30 21:07 GMT+01:00 sgjava <sg...@gmail.com>:

> So all I have to do is add:
>
>     <servlet>
>         <servlet-name>JCSRemoteCacheStartupServlet</servlet-name>
>         <servlet-class>
>
> org.apache.commons.jcs.auxiliary.remote.server.RemoteCacheStartupServlet
>         </servlet-class>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>
>
>     <servlet-mapping>
>         <servlet-name>JCSRemoteCacheStartupServlet</servlet-name>
>         <url-pattern>/jcs</url-pattern>
>     </servlet-mapping>
>
> to web.xml and it's good to go for Java EE? What is the servlet mapping
> used
> for?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031p4677037.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JCS JCache replication

Posted by sgjava <sg...@gmail.com>.
So all I have to do is add:

    <servlet>
        <servlet-name>JCSRemoteCacheStartupServlet</servlet-name>
        <servlet-class>
            
org.apache.commons.jcs.auxiliary.remote.server.RemoteCacheStartupServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>


    <servlet-mapping>
        <servlet-name>JCSRemoteCacheStartupServlet</servlet-name>
        <url-pattern>/jcs</url-pattern>
    </servlet-mapping>

to web.xml and it's good to go for Java EE? What is the servlet mapping used
for?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031p4677037.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JCS JCache replication

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You can, depends the mode you setup:
http://commons.apache.org/proper/commons-jcs/RemoteAuxCache.html

EhCache doesnt have such a mode AFAIK - at least not in the free version.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-30 21:12 GMT+01:00 Steve Goldsmith <sg...@gmail.com>:

> OK, so maybe the best thing for me is to create a simple main class, fire
> up the server and then run my app. Not a huge deal, but at least with
> ehcache 2.x you were able to to do it all through configuration.
>
> On Mon, Nov 30, 2015 at 2:39 PM, Romain Manni-Bucau <rmannibucau@gmail.com
> >
> wrote:
>
> > Starting the server? It is outside EE (even outside the EE server JVM)
> so I
> > guess not at the moment.
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> >
> > 2015-11-30 20:22 GMT+01:00 sgjava <sg...@gmail.com>:
> >
> > > OK, I see where you are boot strapping the server, but is there a way
> to
> > do
> > > it through all configuration? In other words, if I use:
> > >
> > >         <dependency>
> > >             <groupId>org.apache.commons</groupId>
> > >             <artifactId>commons-jcs-jcache</artifactId>
> > >             <version>2.0-SNAPSHOT</version>
> > >         </dependency>
> > >
> > > This way it is agnostic across caching providers. I'm steering away
> from
> > > coding any JCache replication related code.
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031p4677033.html
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>

Re: JCS JCache replication

Posted by Steve Goldsmith <sg...@gmail.com>.
OK, so maybe the best thing for me is to create a simple main class, fire
up the server and then run my app. Not a huge deal, but at least with
ehcache 2.x you were able to to do it all through configuration.

On Mon, Nov 30, 2015 at 2:39 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Starting the server? It is outside EE (even outside the EE server JVM) so I
> guess not at the moment.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-11-30 20:22 GMT+01:00 sgjava <sg...@gmail.com>:
>
> > OK, I see where you are boot strapping the server, but is there a way to
> do
> > it through all configuration? In other words, if I use:
> >
> >         <dependency>
> >             <groupId>org.apache.commons</groupId>
> >             <artifactId>commons-jcs-jcache</artifactId>
> >             <version>2.0-SNAPSHOT</version>
> >         </dependency>
> >
> > This way it is agnostic across caching providers. I'm steering away from
> > coding any JCache replication related code.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031p4677033.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>



-- 
Steven P. Goldsmith

Re: JCS JCache replication

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Starting the server? It is outside EE (even outside the EE server JVM) so I
guess not at the moment.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-30 20:22 GMT+01:00 sgjava <sg...@gmail.com>:

> OK, I see where you are boot strapping the server, but is there a way to do
> it through all configuration? In other words, if I use:
>
>         <dependency>
>             <groupId>org.apache.commons</groupId>
>             <artifactId>commons-jcs-jcache</artifactId>
>             <version>2.0-SNAPSHOT</version>
>         </dependency>
>
> This way it is agnostic across caching providers. I'm steering away from
> coding any JCache replication related code.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031p4677033.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JCS JCache replication

Posted by sgjava <sg...@gmail.com>.
OK, I see where you are boot strapping the server, but is there a way to do
it through all configuration? In other words, if I use:

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-jcs-jcache</artifactId>
            <version>2.0-SNAPSHOT</version>
        </dependency>

This way it is agnostic across caching providers. I'm steering away from
coding any JCache replication related code.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031p4677033.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JCS JCache replication

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Did it for a JUG:

- the server:
https://github.com/rmannibucau/rmannibucau.github.com/blob/master/2015/LorraineJUG/demo/src/main/java/com/github/rmannibucau/jug/lorraine/jcs/remote/RemoteServerLauncher.java
(not this was just by laziness cause there is already a main in jcs)
- the client config:
https://github.com/rmannibucau/rmannibucau.github.com/blob/master/2015/LorraineJUG/demo/src/main/resources/client.properties



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-11-30 20:10 GMT+01:00 sgjava <sg...@gmail.com>:

> Can you configure the client and server on localhost with the same JCS
> configuration file? I want this for an example, so it wouldn't be something
> you'd normally do.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/JCS-JCache-replication-tp4677031.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>