This may sound like a simple question, but I am having trouble getting the
core services in fulcrum to build. Granted, I am not using Ant to build
the files, I am using WebSphere Application Developer IDE, because it does
a nice job of incremental compiling and resolving dependencies. Hoewever,
I am gettting errors like "Cannot throw the type
org.apache.fulcrum.InitializationException"
"Cannot throw the type org.apache.fulcrum.ServiceException"
Is there something that I am missing?
Thanks,
Ray
"Kelvin Tan" <[EMAIL PROTECTED]>
01/07/02 08:11 PM
Please respond to "Kelvin Tan"
To: <[EMAIL PROTECTED]>
cc:
Subject: Re: Fulcrum
Ray,
No problem.
What I've actually done is imported the entire tree from Fulcrum CVS's
src/core into my application hierachy. So I'm using Fulcrum's core service
architecture as my app's service architecture. It's that simple!
After you've done that, you might want to do some cleaning up, like
renaming the package names, and maybe migrate some existing Fulcrum
services over to your app. The reason why you want to do this is so that
any future services you create will be under the
com.mycompany.myapp.services package structure, and you won't have some
services under org.apache.fulcrum and some under
com.mycompany.myapp.services.
There will be at least 2 components to every service you write. The
interface (which extends Service) and the base implementation (which
extends BaseService and implements the service interface). Check out how
they're doing it in Fulcrum to get a good feel. It's real easy. After
you've written the service, you'll want to add a reference to it in
TurbineResources.properties. This stores the service mappings. Check out
how Fulcrum configures it's existing services and you'll get it.
Now you're ready to write a test for your service. I'll give you a snippet
of my test case, and how to use services (in case you don't already know).
public class TurbineServicesTest
extends TestCase
implements Cacheable
{
ServiceManager mgr;
static
{
BasicConfigurator.configure();
Layout layout = new PatternLayout("%L %p %c - %m%n");
}
public TurbineServicesTest(String testName)
{
super(testName);
}
public static void main(String[] args)
{
junit.textui.TestRunner.run(suite());
}
public static Test suite()
{
TestSuite suite = new TestSuite(TurbineServicesTest.class);
return suite;
}
protected void setUp()
{
}
protected void tearDown()
{
}
public void testInit() throws Exception
{
Velocity.init("c:/market/catalina/webapps/myapp/WEB-INF/conf/velocity.properties");
mgr = TurbineServices.getInstance();
ExtendedProperties props = new ExtendedProperties();
mgr.setApplicationRoot("c:/checkout/myapp");
FileInputStream inputStream = new
FileInputStream(mgr.getApplicationRoot() +
"/conf/TurbineResources.properties");
props.load(inputStream);
props.display();
mgr.setConfiguration(props);
mgr.init();
}
public void testPool() throws ServiceException
{
PoolService pool = (PoolService)
TurbineServices.getInstance().getService(PoolService.SERVICE_NAME);
ArrayList list;
list = (ArrayList) pool.getInstance(java.util.ArrayList.class);
int hashCode = list.hashCode();
pool.putInstance(list);
list = (ArrayList) pool.getInstance(java.util.ArrayList.class);
assertEquals("Different objects created", hashCode,
list.hashCode());
pool.putInstance(list);
}
}
Hope that helped. :)
Regards,
Kelvin
----- Original Message -----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 07, 2002 10:23 PM
Subject: Re: Fulcrum
I appreciate your offer to help. Could you give me some examples as to how
you are using it as a stand alone? If I am viewig it correctly, it seems
like a great mechanism to configure the functionality of any application.
As I am new to it though, I am still trying to get my mind around some
concrete examples.
Thanks again!
Ray Grieselhuber
"Kelvin Tan" <[EMAIL PROTECTED]>
01/04/02 09:57 PM
Please respond to "Turbine Users List"
To: "Turbine Users List" <[EMAIL PROTECTED]>
cc: (bcc: Ray Grieselhuber/Teamwork)
Subject: Re: Fulcrum
I'm currently using the Fulcrum services framework as a stand-alone. You
can
contact me offline if you need any help. :)
Regards,
Kelvin
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: Turbine Users List <[EMAIL PROTECTED]>
Sent: Saturday, January 05, 2002 3:07 AM
Subject: Re: Fulcrum
> So is it safe to assume that everything from the "services" directory is
> "Fulcrum"? And just to confirm, this is true with the current release?
> Thanks,
> Ray
>
>
>
>
>
> Jason van Zyl <[EMAIL PROTECTED]>
> 01/04/02 01:59 PM
> Please respond to "Turbine Users List"
>
>
> To: Turbine Users List <[EMAIL PROTECTED]>
> cc: (bcc: Ray Grieselhuber/Teamwork)
> Subject: Re: Fulcrum
>
>
> On 1/4/02 1:27 PM, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]>
> wrote:
>
> > I am interested in looking at the Fulcrum services framework as a
stand
> > alone system. I didn't see a seperate download area for this -- is
there
> a
> > particular version of Turbine that I should be looking for the stand
> > alone?
>
> Fulcrum doesn't depend on Turbine, but there are still some naming
> conventions that might make it look like it does. Fulcrum isn't released
> so
> there isn't actually an official release.
>
> > Thanks,
> > Ray
> >
> >
> >
>
> --
>
> jvz.
>
> Jason van Zyl
>
> http://tambora.zenplex.org
> http://jakarta.apache.org/turbine
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/alexandria
> http://jakarta.apache.org/commons
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>