hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan <r...@evine.ca>
Subject Re: Using hivemind as an object factory?
Date Fri, 31 Mar 2006 22:14:47 GMT
You'll need to create a seperate service for each real file system path, 
but here goes my attempt to help.

In your hivemodule.xml file:

   <service-point id="Stitch1"  interface="StitchFolder">
     <invoke-factory>
       <construct class="StitchFolder">
         <string>/usr/local/stitch1</string>
       </construct>
     </invoke-factory>
   </service-point>

Then you will need to inject this service into your code. Or maybe into 
another service that organizes all your virtal file systems.

Is this all you're looking to use Hivemind for? I find it's not the sort 
of tool I can add in later, as it changes the way I develop (way more 
modular). If all you need is a singleton factory, I would likely just do 
it the 'old fashioned way'. But hey, I'm no Hivemind expert.

--Ryan

spamsucks wrote:
> 
> I have a set of pojos.  Each pojo represents a distinct virtual file 
> system (a stitch system).  Each of these pojo's take a distinct 
> constructor argument (the file system path to the real file system).  
> The problem that I am having is that I want only one pojo for each 
> distinct file system path.  I do not want multiple instances of a pojo 
> all pointing to the same file system location.  Up to now, I have not 
> been concerned over lifecycle of these pojo's and just creating them via 
> the constructor (e.g. StitchFolder stitch = new 
> StitchFolder("/usr/local/stitch1"))
> While I could "code up" a singleton factory, I would rather see how 
> hivemind would help me out here.  I would appreciate a pointer on an 
> example that does as I described above.
> 
> 
> Thanks.
> 
> Phillip
> 
> http://stitches.authsum.org
> The first CMS library


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


Mime
View raw message