RE: RE: RE: Hivemind: creating a pooled service

2006-07-28 Thread James Carman
Glad to help!  Yeah, the cleanupThread() stuff is *very* important in
HiveMind.  That's how we cleanup thread-local resources and the like.  So,
if you ever do any asynchronous processing inside a registry, make sure you
call cleanupThread() when the asynchronous process is done or you'll waste
resources.

-Original Message-
From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 28, 2006 8:30 AM
To: Tapestry users
Subject: RE: RE: RE: Hivemind: creating a pooled service

ok, now i get it in order to put an object back to the pool i
have to release it somehow my mistake

 i've seen it in org.apache.tapestry.ApplicationServlet but had no
clue what it was for :)

it works fine now

thank you




   
 "James Carman"
 <[EMAIL PROTECTED] 
 ulting.com>An 
"'Tapestry users'" 
 28.07.2006 14:12   
 Kopie 
   
  Bitte antwortenThema 
an  RE: RE: Hivemind: creating a   
 "Tapestry users"   pooled service 
 <[EMAIL PROTECTED] 
pache.org> 
   
   
   
   




Try this:

public void run()
{
  IPooledObject o = (IPooledObject) registry
  .getService("cross.pooledObject",IPooledObject.class);
  System.out.println("ObjectID: " + o.getValue());
  registry.cleanupThread();
}

See what you get.  The pooled lifecycle model doesn't know when to release
stuff if you don't clean up your current thread.

-Original Message-
From: Kristian Marinkovic [mailto:[EMAIL PROTECTED]
Sent: Friday, July 28, 2006 8:09 AM
To: Tapestry users
Subject: RE: RE: Hivemind: creating a pooled service

hi james,

the error message does not occur any more. But the objects are still
not being pooled. my testcode looks like this:

public class PoolTest implements Runnable {

public static Registry registry = null;

public static void main(String[] args) throws InterruptedException {
registry = RegistryBuilder.constructDefaultRegistry();

Thread[] a = new Thread[10];
for(int i=0;iAn
"'Tapestry users'"
 28.07.2006 13:32   
 Kopie

  Bitte antwortenThema
an  RE: Hivemind: creating a pooled
 "Tapestry users"   service
 <[EMAIL PROTECTED]
pache.org>








FYI, the HiveMind mailing lists have been moved.  We are moving to an
Apache
top-level project, but we haven't moved the website yet.  Anyway, have you
tried this:



This tells HiveMind that your implementation factory doesn't expect any
parameters.

-Original Message-
From: Kristian Marinkovic [mailto:[EMAIL PROTECTED]
Sent: Friday, July 28, 2006 6:28 AM
To: Tapestry users
Subject: Hivemind: creating a pooled service


hi,

could someone tell me howto configure hivemind to get me a
object with a "pooled"  lifecycle which, if the pool is empty, uses
a own factory or provider to generate it?

my configuration doesn't pool the object and returns a
"Parameters to service implementation factory
pooledObjectProvider contains no contributions
but expects exactly one contribution." error
message















g,
kris

P.S. i always get a failure notive when i try to subscribe to the hivemind
mailinglist


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMA

RE: RE: RE: Hivemind: creating a pooled service

2006-07-28 Thread Kristian Marinkovic
ok, now i get it in order to put an object back to the pool i
have to release it somehow my mistake

 i've seen it in org.apache.tapestry.ApplicationServlet but had no
clue what it was for :)

it works fine now

thank you




   
 "James Carman"
 <[EMAIL PROTECTED] 
 ulting.com>An 
"'Tapestry users'" 
 28.07.2006 14:12   
 Kopie 
   
  Bitte antwortenThema 
an  RE: RE: Hivemind: creating a   
 "Tapestry users"   pooled service 
 <[EMAIL PROTECTED] 
pache.org> 
   
   
   
   




Try this:

public void run()
{
  IPooledObject o = (IPooledObject) registry
  .getService("cross.pooledObject",IPooledObject.class);
  System.out.println("ObjectID: " + o.getValue());
  registry.cleanupThread();
}

See what you get.  The pooled lifecycle model doesn't know when to release
stuff if you don't clean up your current thread.

-Original Message-
From: Kristian Marinkovic [mailto:[EMAIL PROTECTED]
Sent: Friday, July 28, 2006 8:09 AM
To: Tapestry users
Subject: RE: RE: Hivemind: creating a pooled service

hi james,

the error message does not occur any more. But the objects are still
not being pooled. my testcode looks like this:

public class PoolTest implements Runnable {

public static Registry registry = null;

public static void main(String[] args) throws InterruptedException {
registry = RegistryBuilder.constructDefaultRegistry();

Thread[] a = new Thread[10];
for(int i=0;iAn
"'Tapestry users'"
 28.07.2006 13:32   
 Kopie

  Bitte antwortenThema
an  RE: Hivemind: creating a pooled
 "Tapestry users"   service
 <[EMAIL PROTECTED]
pache.org>








FYI, the HiveMind mailing lists have been moved.  We are moving to an
Apache
top-level project, but we haven't moved the website yet.  Anyway, have you
tried this:



This tells HiveMind that your implementation factory doesn't expect any
parameters.

-Original Message-
From: Kristian Marinkovic [mailto:[EMAIL PROTECTED]
Sent: Friday, July 28, 2006 6:28 AM
To: Tapestry users
Subject: Hivemind: creating a pooled service


hi,

could someone tell me howto configure hivemind to get me a
object with a "pooled"  lifecycle which, if the pool is empty, uses
a own factory or provider to generate it?

my configuration doesn't pool the object and returns a
"Parameters to service implementation factory
pooledObjectProvider contains no contributions
but expects exactly one contribution." error
message















g,
kris

P.S. i always get a failure notive when i try to subscribe to the hivemind
mailinglist


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]