You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by hi...@jakarta.apache.org on 2004/06/28 17:05:54 UTC

[jira] Created: (HIVEMIND-14) Add a new model named "new" to constuct the class

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-14
    Summary: Add a new model named "new" to constuct the class
       Type: New Feature

     Status: Open
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: Howard M. Lewis Ship
   Reporter: patofan

    Created: Mon, 28 Jun 2004 8:03 AM
    Updated: Mon, 28 Jun 2004 8:03 AM
Environment: window XP , JDK1.4.2

Description:
I need a "new model" feature to create new instance at each calling the service. 

For example as following :
   
/* XML configuration */

<service-point id="ERPOrder"     interface="test.Order" model="new">
<create-instance  class="test.OrderImpl"/>
</service-point>


/* java code */


import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;

public class Main
{

  public static void main(String[] args)
  {

    Registry registry =  RegistryBuilder.constructDefaultRegistry();

    test.Order order1 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


    test.Order order2 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


 /* I hope the result is " order1 is not equal to order2". */

    System.out.println( "result of order1 and order2 is " +     ( order1 != order2 ) ? "not equal" : "equal" );

  }
}





 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Closed: (HIVEMIND-14) Add a new model named "new" to constuct the class

Posted by hi...@jakarta.apache.org.
Message:

   The following issue has been closed.

   Resolver: Howard M. Lewis Ship
       Date: Sat, 17 Jul 2004 2:49 PM

Given that there's other solutions already in the framework that may be a better fit (threaded), and that you can add your own service models if you wish, I see no reason to procede on this change.
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-14
    Summary: Add a new model named "new" to constuct the class
       Type: New Feature

     Status: Closed
   Priority: Major
 Resolution: WON'T FIX

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: Howard M. Lewis Ship
   Reporter: patofan

    Created: Mon, 28 Jun 2004 8:03 AM
    Updated: Sat, 17 Jul 2004 2:49 PM
Environment: window XP , JDK1.4.2

Description:
I need a "new model" feature to create new instance at each calling the service. 

For example as following :
   
/* XML configuration */

<service-point id="ERPOrder"     interface="test.Order" model="new">
<create-instance  class="test.OrderImpl"/>
</service-point>


/* java code */


import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;

public class Main
{

  public static void main(String[] args)
  {

    Registry registry =  RegistryBuilder.constructDefaultRegistry();

    test.Order order1 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


    test.Order order2 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


 /* I hope the result is " order1 is not equal to order2". */

    System.out.println( "result of order1 and order2 is " +     ( order1 != order2 ) ? "not equal" : "equal" );

  }
}





 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Commented: (HIVEMIND-14) Add a new model named "new" to constuct the class

Posted by hi...@jakarta.apache.org.
The following comment has been added to this issue:

     Author: Howard M. Lewis Ship
    Created: Mon, 28 Jun 2004 3:15 PM
       Body:
I believe that Spring calls this "prototype".
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/HIVEMIND-14?page=comments#action_36402

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-14
    Summary: Add a new model named "new" to constuct the class
       Type: New Feature

     Status: Open
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: Howard M. Lewis Ship
   Reporter: patofan

    Created: Mon, 28 Jun 2004 8:03 AM
    Updated: Mon, 28 Jun 2004 3:15 PM
Environment: window XP , JDK1.4.2

Description:
I need a "new model" feature to create new instance at each calling the service. 

For example as following :
   
/* XML configuration */

<service-point id="ERPOrder"     interface="test.Order" model="new">
<create-instance  class="test.OrderImpl"/>
</service-point>


/* java code */


import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;

public class Main
{

  public static void main(String[] args)
  {

    Registry registry =  RegistryBuilder.constructDefaultRegistry();

    test.Order order1 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


    test.Order order2 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


 /* I hope the result is " order1 is not equal to order2". */

    System.out.println( "result of order1 and order2 is " +     ( order1 != order2 ) ? "not equal" : "equal" );

  }
}





 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Commented: (HIVEMIND-14) Add a new model named "new" to constuct the class

Posted by hi...@jakarta.apache.org.
The following comment has been added to this issue:

     Author: James Carman
    Created: Mon, 28 Jun 2004 3:00 PM
       Body:
Oh, and if this DOES become a service model, I wouldn't suggest calling it "new."  I would think InstantiatingServiceModel or something like that.  The word "new" has too many other connotations IMHO.
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/HIVEMIND-14?page=comments#action_36401

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-14
    Summary: Add a new model named "new" to constuct the class
       Type: New Feature

     Status: Open
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: Howard M. Lewis Ship
   Reporter: patofan

    Created: Mon, 28 Jun 2004 8:03 AM
    Updated: Mon, 28 Jun 2004 3:00 PM
Environment: window XP , JDK1.4.2

Description:
I need a "new model" feature to create new instance at each calling the service. 

For example as following :
   
/* XML configuration */

<service-point id="ERPOrder"     interface="test.Order" model="new">
<create-instance  class="test.OrderImpl"/>
</service-point>


/* java code */


import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;

public class Main
{

  public static void main(String[] args)
  {

    Registry registry =  RegistryBuilder.constructDefaultRegistry();

    test.Order order1 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


    test.Order order2 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


 /* I hope the result is " order1 is not equal to order2". */

    System.out.println( "result of order1 and order2 is " +     ( order1 != order2 ) ? "not equal" : "equal" );

  }
}





 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Commented: (HIVEMIND-14) Add a new model named "new" to constuct the class

Posted by hi...@jakarta.apache.org.
The following comment has been added to this issue:

     Author: Howard M. Lewis Ship
    Created: Mon, 28 Jun 2004 10:03 AM
       Body:
You can implement this yourself, today, by defining your own ServiceModel and ServiceModelFactory.

However, the call to getRegistry() would return the same instance ... invoking a method on that instance would, inside some form of proxy, create an instance of the service.

I would like to know *why* you feel you need this feature. What is your use case and why does the threaded and pooled service models not meet it?
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/HIVEMIND-14?page=comments#action_36392

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-14
    Summary: Add a new model named "new" to constuct the class
       Type: New Feature

     Status: Open
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: Howard M. Lewis Ship
   Reporter: patofan

    Created: Mon, 28 Jun 2004 8:03 AM
    Updated: Mon, 28 Jun 2004 10:03 AM
Environment: window XP , JDK1.4.2

Description:
I need a "new model" feature to create new instance at each calling the service. 

For example as following :
   
/* XML configuration */

<service-point id="ERPOrder"     interface="test.Order" model="new">
<create-instance  class="test.OrderImpl"/>
</service-point>


/* java code */


import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;

public class Main
{

  public static void main(String[] args)
  {

    Registry registry =  RegistryBuilder.constructDefaultRegistry();

    test.Order order1 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


    test.Order order2 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


 /* I hope the result is " order1 is not equal to order2". */

    System.out.println( "result of order1 and order2 is " +     ( order1 != order2 ) ? "not equal" : "equal" );

  }
}





 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Commented: (HIVEMIND-14) Add a new model named "new" to constuct the class

Posted by hi...@jakarta.apache.org.
The following comment has been added to this issue:

     Author: Howard M. Lewis Ship
    Created: Sat, 17 Jul 2004 2:48 PM
       Body:
You can use a threaded service model, rather than new. It will be associated with just the current thread and can hold state. It will be discarded at the end of the current request/transaction (i.e., when you invoke Registry.cleanupThread() ). 

I'm using this approach in Tapestry 3.1; I have a service that holds the current request and response objects (provided by the Servlet API), and that service is threaded.  All the other services are singleton, and the few that need to know about the current request can retrieve that data as needed from the RequestHolder service (or whatever I called it).

Remember that proxies to threaded services can be shared between threads (but that each thread will be connected to its own, unique, private service implementation).
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/HIVEMIND-14?page=comments#action_36725

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-14
    Summary: Add a new model named "new" to constuct the class
       Type: New Feature

     Status: Open
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: Howard M. Lewis Ship
   Reporter: patofan

    Created: Mon, 28 Jun 2004 8:03 AM
    Updated: Sat, 17 Jul 2004 2:48 PM
Environment: window XP , JDK1.4.2

Description:
I need a "new model" feature to create new instance at each calling the service. 

For example as following :
   
/* XML configuration */

<service-point id="ERPOrder"     interface="test.Order" model="new">
<create-instance  class="test.OrderImpl"/>
</service-point>


/* java code */


import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;

public class Main
{

  public static void main(String[] args)
  {

    Registry registry =  RegistryBuilder.constructDefaultRegistry();

    test.Order order1 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


    test.Order order2 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


 /* I hope the result is " order1 is not equal to order2". */

    System.out.println( "result of order1 and order2 is " +     ( order1 != order2 ) ? "not equal" : "equal" );

  }
}





 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Commented: (HIVEMIND-14) Add a new model named "new" to constuct the class

Posted by hi...@jakarta.apache.org.
The following comment has been added to this issue:

     Author: James Carman
    Created: Mon, 28 Jun 2004 2:57 PM
       Body:
I HOPE you're not trying to implement some sort of "stateful" service.  That's a bad idea.  Are the service implementation objects inherently unpoolable, even if you implement the PoolManageable interface?  

If you REALLY need this sort of functionality, you can implement it yourself without having to create some special service model.  All you have to do is allow your service to be a wrapper for a "logic bean", similar to how people suggest we develop EJBs.  I don't know if it's officially a design pattern or what the name of it is, but it's easy to implement.  Inside one of your service methods, instantiate the logic bean and use it.  Once the method returns, the logic bean is no more.  This is essentially what the proxy object would do IF there were a "new" service model.  But, I agree with Howard on this one.  The question is WHY you need this sort of functionality.  Hope that helps
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/HIVEMIND-14?page=comments#action_36400

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-14
    Summary: Add a new model named "new" to constuct the class
       Type: New Feature

     Status: Open
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: Howard M. Lewis Ship
   Reporter: patofan

    Created: Mon, 28 Jun 2004 8:03 AM
    Updated: Mon, 28 Jun 2004 2:57 PM
Environment: window XP , JDK1.4.2

Description:
I need a "new model" feature to create new instance at each calling the service. 

For example as following :
   
/* XML configuration */

<service-point id="ERPOrder"     interface="test.Order" model="new">
<create-instance  class="test.OrderImpl"/>
</service-point>


/* java code */


import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;

public class Main
{

  public static void main(String[] args)
  {

    Registry registry =  RegistryBuilder.constructDefaultRegistry();

    test.Order order1 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


    test.Order order2 =
      (test.Order) registry.getService("ERPOrder", test.OrderImpl.class);


 /* I hope the result is " order1 is not equal to order2". */

    System.out.println( "result of order1 and order2 is " +     ( order1 != order2 ) ? "not equal" : "equal" );

  }
}





 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org