You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by tv...@apache.org on 2007/05/05 08:58:51 UTC
svn commit: r535465 [14/49] - in /jakarta/turbine/fulcrum/trunk: ./ bsf/
bsf/src/java/org/apache/fulcrum/bsf/ bsf/src/test/ bsf/xdocs/ cache/
cache/src/java/org/apache/fulcrum/cache/
cache/src/java/org/apache/fulcrum/cache/impl/ cache/src/test/ cache/s...
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/ServiceableJobListener.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/ServiceableJobListener.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/ServiceableJobListener.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/ServiceableJobListener.java Fri May 4 23:58:06 2007
@@ -1,18 +1,21 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.fulcrum.quartz.listener;
@@ -30,8 +33,8 @@
* @author <a href="mailto:leandro@ibnetwork.com.br">Leandro Rodrigo Saad Cruz</a>
*
*/
-public interface ServiceableJobListener
+public interface ServiceableJobListener
extends JobListener,Serviceable,Disposable
{
-
+
}
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/impl/ServiceableJobListenerWrapper.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/impl/ServiceableJobListenerWrapper.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/impl/ServiceableJobListenerWrapper.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/java/org/apache/fulcrum/quartz/listener/impl/ServiceableJobListenerWrapper.java Fri May 4 23:58:06 2007
@@ -1,18 +1,21 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.fulcrum.quartz.listener.impl;
@@ -30,28 +33,28 @@
/**
* Wrapper for listeners to call compose on job instances that implement Composable
- *
+ *
* @author <a href="mailto:leandro@ibnetwork.com.br">Leandro Rodrigo Saad Cruz</a>
*
*/
-public class ServiceableJobListenerWrapper
+public class ServiceableJobListenerWrapper
implements ServiceableJobListener
{
protected JobListener wrappedListener;
-
+
protected Log logger = LogFactory.getLog(ServiceableJobListener.class.getName());
protected ServiceManager manager;
/**
- *
+ *
*/
public ServiceableJobListenerWrapper(JobListener listener)
{
wrappedListener = listener;
}
- public void service(ServiceManager manager)
+ public void service(ServiceManager manager)
throws ServiceException
{
this.manager = manager;
@@ -65,12 +68,12 @@
manager = null;
logger = null;
}
-
-
+
+
/**
* Calls getName() on wrappedListener
- *
+ *
* @see org.quartz.JobListener#getName()
*/
public String getName()
@@ -79,7 +82,7 @@
}
/**
- * Calls compose() on Job instance if it implements Composable
+ * Calls compose() on Job instance if it implements Composable
* @see org.quartz.JobListener#jobToBeExecuted(org.quartz.JobExecutionContext)
*/
public void jobToBeExecuted(JobExecutionContext context)
@@ -111,7 +114,7 @@
logger.debug("Job that was executed [" + job+"] Wrapped Listener ["+wrappedListener+"]");
wrappedListener.jobWasExecuted(context,ex);
}
-
+
/* (non-Javadoc)
* @see org.quartz.JobListener#jobExecutionVetoed(org.quartz.JobExecutionContext)
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/TestComponentConfig.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/TestComponentConfig.xml?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/TestComponentConfig.xml (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/TestComponentConfig.xml Fri May 4 23:58:06 2007
@@ -1,6 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<componentConfig>
- <quartz>
+ <quartz>
<globalJobListener className="org.apache.fulcrum.quartz.listener.FooListener" />
<scheduled jobName="simpleJob" jobGroup="DEFAULT_GROUP" triggerName="cron" triggerGroup="OTHER_GROUP"/>
<jobDetails>
@@ -23,7 +42,7 @@
<shouldRecover>false</shouldRecover>
<jobListeners/>
</org.quartz.JobDetail>
- </list>
+ </list>
</jobDetails>
<triggers>
<list>
@@ -43,17 +62,17 @@
<default>
<cronExpression>0 0 12 * * ?</cronExpression>
<startTime>2005-10-20 11:10:45.0 EDT</startTime>
-
+
</default>
</org.quartz.CronTrigger>
</org.quartz.CronTrigger>
- <org.quartz.SimpleTrigger>
+ <org.quartz.SimpleTrigger>
<name>simpleTrigger</name>
<group>DEFAULT_GROUP</group>
<description>test</description>
-
- </org.quartz.SimpleTrigger>
- </list>
- </triggers>
+
+ </org.quartz.SimpleTrigger>
+ </list>
+ </triggers>
</quartz>
-</componentConfig>
\ No newline at end of file
+</componentConfig>
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/TestRoleConfig.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/TestRoleConfig.xml?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/TestRoleConfig.xml (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/TestRoleConfig.xml Fri May 4 23:58:06 2007
@@ -1,8 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<!-- This configuration file for Avalon components is used for testing the TestComponent -->
<role-list>
<role
name="org.apache.fulcrum.quartz.QuartzScheduler"
shorthand="quartz"
- default-class="org.apache.fulcrum.quartz.impl.DefaultQuartzScheduler"/>
-
-</role-list>
\ No newline at end of file
+ default-class="org.apache.fulcrum.quartz.impl.DefaultQuartzScheduler"/>
+
+</role-list>
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/BaseQuartzTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/BaseQuartzTestCase.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/BaseQuartzTestCase.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/BaseQuartzTestCase.java Fri May 4 23:58:06 2007
@@ -1,17 +1,20 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.fulcrum.quartz;
@@ -22,7 +25,7 @@
/**
* Handle looking up and then the icky cleanup of Quartz.
- *
+ *
* @author <a href="mailto:epughNOSPAM@opensourceconnections.com">Eric Pugh </a>
*/
public class BaseQuartzTestCase extends BaseUnitTest {
@@ -31,23 +34,23 @@
public BaseQuartzTestCase(String arg0) {
super(arg0);
}
-
+
public BaseQuartzTestCase() {
super("");
- }
+ }
public void setUp() throws Exception {
quartz = (QuartzScheduler) lookup(QuartzScheduler.ROLE);
-
+
SimpleJob.reset();
}
-
+
public void tearDown() {
release(QuartzScheduler.ROLE);
SimpleJob.reset();
super.tearDown();
}
-}
\ No newline at end of file
+}
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/DefaultQuartzSchedulerImplTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/DefaultQuartzSchedulerImplTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/DefaultQuartzSchedulerImplTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/DefaultQuartzSchedulerImplTest.java Fri May 4 23:58:06 2007
@@ -1,17 +1,20 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.fulcrum.quartz;
@@ -110,4 +113,4 @@
}
-}
\ No newline at end of file
+}
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/SchedulerShutDownTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/SchedulerShutDownTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/SchedulerShutDownTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/SchedulerShutDownTest.java Fri May 4 23:58:06 2007
@@ -1,18 +1,21 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.fulcrum.quartz;
@@ -27,7 +30,7 @@
/**
* @author <a href="mailto:leandro@ibnetwork.com.br">Leandro Rodrigo Saad Cruz</a>
* @author <a href="mailto:epughNOSPAM@opensourceconnections.com">Eric Pugh </a>
- *
+ *
*/
public class SchedulerShutDownTest extends BaseQuartzTestCase implements SchedulerListener {
@@ -48,7 +51,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#jobScheduled(org.quartz.Trigger)
*/
public void jobScheduled(Trigger arg0) {
@@ -57,7 +60,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#jobUnscheduled(java.lang.String,
* java.lang.String)
*/
@@ -67,7 +70,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#triggerFinalized(org.quartz.Trigger)
*/
public void triggerFinalized(Trigger arg0) {
@@ -76,7 +79,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#triggersPaused(java.lang.String,
* java.lang.String)
*/
@@ -86,7 +89,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#triggersResumed(java.lang.String,
* java.lang.String)
*/
@@ -96,7 +99,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#jobsPaused(java.lang.String,
* java.lang.String)
*/
@@ -106,7 +109,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#jobsResumed(java.lang.String,
* java.lang.String)
*/
@@ -116,7 +119,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#schedulerError(java.lang.String,
* org.quartz.SchedulerException)
*/
@@ -126,11 +129,11 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.quartz.SchedulerListener#schedulerShutdown()
*/
public void schedulerShutdown() {
System.out.println("ShutingDown scheduler !");
}
-}
\ No newline at end of file
+}
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/XStreamTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/XStreamTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/XStreamTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/XStreamTest.java Fri May 4 23:58:06 2007
@@ -1,18 +1,21 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.fulcrum.quartz;
@@ -34,9 +37,9 @@
/**
* Verify that XStream works properly. Also shows us what the XStream output
* will look like.
- *
+ *
* @author <a href="mailto:epughNOSPAM@opensourceconnections.com">Eric Pugh</a>
- *
+ *
*/
public class XStreamTest extends TestCase {
@@ -48,50 +51,50 @@
{
List triggers = new ArrayList();
XStream xstream = new XStream(new DomDriver()); // does not require XPP3 library
-
+
Trigger st = new SimpleTrigger("bob","jones");
String xml = xstream.toXML(st);
// System.out.println(xml);
SimpleTrigger st2 = (SimpleTrigger)xstream.fromXML(xml);
assertEquals(st,st2);
triggers.add(st2);
-
+
CronTrigger st3 = new CronTrigger("cron","jones","jobName","jobGroup","0 0 12 * * ?");
xml = xstream.toXML(st3);
System.out.println(xml);
CronTrigger st4 = (CronTrigger)xstream.fromXML(xml);
assertEquals(st3,st4);
triggers.add(st4);
-
+
xml = xstream.toXML(triggers);
//System.out.println(xml);
-
-
+
+
}
-
+
public void testSavingTwoJobsWXstream() throws Exception
{
List jobs = new ArrayList();
XStream xstream = new XStream(new DomDriver()); // does not require XPP3 library
-
+
JobDetail st = new JobDetail("bob","jones",SimpleJob.class);
String xml = xstream.toXML(st);
// System.out.println(xml);
JobDetail st2 = (JobDetail)xstream.fromXML(xml);
assertEquals(st.getFullName(),st2.getFullName());
jobs.add(st2);
-
+
JobDetail st3 = new JobDetail("bob2","jones2",NotSoSimpleJob.class);
xml = xstream.toXML(st3);
// System.out.println(xml);
JobDetail st4 = (JobDetail)xstream.fromXML(xml);
assertEquals(st3.getFullName(),st4.getFullName());
jobs.add(st4);
-
+
xml = xstream.toXML(jobs);
// System.out.println(xml);
-
-
+
+
}
-}
\ No newline at end of file
+}
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/listener/FooListener.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/listener/FooListener.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/listener/FooListener.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/listener/FooListener.java Fri May 4 23:58:06 2007
@@ -1,18 +1,21 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.fulcrum.quartz.listener;
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/NotSoSimpleJob.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/NotSoSimpleJob.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/NotSoSimpleJob.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/NotSoSimpleJob.java Fri May 4 23:58:06 2007
@@ -1,18 +1,21 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.fulcrum.quartz.test;
@@ -27,17 +30,17 @@
* @author <a href="mailto:leandro@ibnetwork.com.br">Leandro Rodrigo Saad Cruz</a>
*
*/
-public class NotSoSimpleJob
+public class NotSoSimpleJob
implements Job,Serviceable
{
public static boolean executed = false;
-
+
public static boolean serviced = false;
private ServiceManager manager;
/**
- *
+ *
*/
public NotSoSimpleJob()
{
@@ -47,7 +50,7 @@
/**
* @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
*/
- public void execute(JobExecutionContext context)
+ public void execute(JobExecutionContext context)
throws JobExecutionException
{
executed = true;
@@ -55,10 +58,10 @@
/**
* This method is called by ComposableJobListenerWrapper.jobToBeExecuted
- *
+ *
* @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
*/
- public void service(ServiceManager manager)
+ public void service(ServiceManager manager)
throws ServiceException
{
this.manager = manager;
Modified: jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/SimpleJob.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/SimpleJob.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/SimpleJob.java (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/src/test/org/apache/fulcrum/quartz/test/SimpleJob.java Fri May 4 23:58:06 2007
@@ -1,18 +1,21 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.fulcrum.quartz.test;
@@ -24,16 +27,16 @@
* @author <a href="mailto:leandro@ibnetwork.com.br">Leandro Rodrigo Saad Cruz</a>
*
*/
-public class SimpleJob
+public class SimpleJob
implements Job
{
public static boolean executed = false;
-
+
public static boolean composed = false;
/**
- *
+ *
*/
public SimpleJob()
{
@@ -43,12 +46,12 @@
/**
* @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
*/
- public void execute(JobExecutionContext context)
+ public void execute(JobExecutionContext context)
throws JobExecutionException
{
executed = true;
}
-
+
public static void reset(){
executed=false;
composed=false;
Modified: jakarta/turbine/fulcrum/trunk/quartz/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/xdocs/changes.xml?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/xdocs/changes.xml (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/xdocs/changes.xml Fri May 4 23:58:06 2007
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<document>
<properties>
<title>Fulcrum Quartz</title>
@@ -12,21 +30,21 @@
</action>
<action dev="epugh" type="update">
Upgrade to Quartz 1.5, update for the new xstream xml format for CronTrigger.
- </action>
- </release>
+ </action>
+ </release>
<release version="1.0" date="2004-11-24">
<action dev="epugh" type="add">
If you provide a jobName and jobGroup for a trigger it will autoschedule
that component.
- </action>
+ </action>
<action dev="epugh" type="update">
Removed the component Factory for loading jobdetails and triggers
in favor of xstream
- </action>
+ </action>
<action dev="epugh" type="update">
Initial import
- </action>
- </release>
+ </action>
+ </release>
</body>
</document>
Modified: jakarta/turbine/fulcrum/trunk/quartz/xdocs/index.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/xdocs/index.xml?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/xdocs/index.xml (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/xdocs/index.xml Fri May 4 23:58:06 2007
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<document>
@@ -13,12 +31,12 @@
<p>
This Service functions as a wrapper around the Quartz Scheduler
</p>
-
+
<p>
It is written for use in any Avalon compatible container.
- </p>
+ </p>
</section>
-
+
<section name="Configuration">
<p>
@@ -40,7 +58,7 @@
<source>
<![CDATA[
- <quartz>
+ <quartz>
<globalJobListener className="org.apache.fulcrum.quartz.listener.FooListener" />
<jobDetails>
<list>
@@ -62,7 +80,7 @@
<shouldRecover>false</shouldRecover>
<jobListeners/>
</org.quartz.JobDetail>
- </list>
+ </list>
</jobDetails>
<triggers>
<list>
@@ -82,33 +100,33 @@
<default>
<cronExpression>0 0 12 * * ?</cronExpression>
<startTime>2005-10-20 11:10:45.0 EDT</startTime>
-
+
</default>
</org.quartz.CronTrigger>
</org.quartz.CronTrigger>
- <org.quartz.SimpleTrigger>
+ <org.quartz.SimpleTrigger>
<name>simpleTrigger</name>
<group>DEFAULT_GROUP</group>
<description>test</description>
-
- </org.quartz.SimpleTrigger>
- </list>
- </triggers>
+
+ </org.quartz.SimpleTrigger>
+ </list>
+ </triggers>
</quartz>
]]>
</source>
- <b>Note:</b> The section for CronTrigger is Quartz 1.5 specific. For Quartz 1.4, you may need to tweak the cronTrigger pattern.
+ <b>Note:</b> The section for CronTrigger is Quartz 1.5 specific. For Quartz 1.4, you may need to tweak the cronTrigger pattern.
</section>
<section name="Usage">
-
+
<p>
Please look at the unit tests.
</p>
- </section>
+ </section>
</body>
</document>
Modified: jakarta/turbine/fulcrum/trunk/quartz/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/quartz/xdocs/navigation.xml?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/quartz/xdocs/navigation.xml (original)
+++ jakarta/turbine/fulcrum/trunk/quartz/xdocs/navigation.xml Fri May 4 23:58:06 2007
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<project
name="cache"
href="http://jakarta.apache.org/turbine/fulcrum/cache/">
@@ -10,11 +28,11 @@
<item name="Fulcrum"
href="http://jakarta.apache.org/turbine/fulcrum/"/>
<item name="Quartz"
- href="http://www.opensymphony.com/quartz"/>
+ href="http://www.opensymphony.com/quartz"/>
</links>
<menu name="Overview">
<item name="Main" href="/index.html"/>
</menu>
</body>
-</project>
\ No newline at end of file
+</project>
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/project.properties
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/project.properties?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/project.properties (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/project.properties Fri May 4 23:58:06 2007
@@ -1,2 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
# display the date on the site
-maven.xdoc.date = left
\ No newline at end of file
+maven.xdoc.date = left
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/project.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/project.xml?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/project.xml (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/project.xml Fri May 4 23:58:06 2007
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<project>
<extend>${basedir}/../project.xml</extend>
<id>fulcrum-resourcemanager</id>
@@ -6,14 +24,14 @@
<currentVersion>1.0.1-dev</currentVersion>
<dependencies>
-
+
<!-- Needed only for testing -->
<dependency>
<groupId>fulcrum</groupId>
<artifactId>fulcrum-testcontainer</artifactId>
<version>1.0.5</version>
</dependency>
-
+
<dependency>
<groupId>fulcrum</groupId>
<artifactId>fulcrum-yaafi</artifactId>
@@ -24,7 +42,7 @@
<groupId>fulcrum</groupId>
<artifactId>fulcrum-pbe</artifactId>
<version>1.0.0</version>
- </dependency>
+ </dependency>
</dependencies>
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java Fri May 4 23:58:06 2007
@@ -1,20 +1,22 @@
package org.apache.fulcrum.resourcemanager;
/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
import java.io.IOException;
@@ -42,15 +44,15 @@
/////////////////////////////////////////////////////////////////////////
// CRUD Functionality
/////////////////////////////////////////////////////////////////////////
-
- /**
+
+ /**
* @return the domain of this resource manager
*/
String getDomain();
-
+
/**
* List all avaible resources recursively for a domain.
- *
+ *
* @return list of all available resources for the domain
*/
String[] listResources();
@@ -62,13 +64,13 @@
* @return true if the resource exists
*/
boolean exists( String resourcePath );
-
+
/**
* Saves a resource.
*
* @param resourcePath the path of the resource
* @param resourceContent the content of the resource
- * @exception IOException accessing the resource failed
+ * @exception IOException accessing the resource failed
*/
void create( String resourcePath, Object resourceContent )
throws IOException;
@@ -78,7 +80,7 @@
*
* @param resourcePath the path of the resource
* @return the content of the resource
- * @exception IOException accessing the resource failed
+ * @exception IOException accessing the resource failed
*/
byte[] read( String resourcePath )
throws IOException;
@@ -88,7 +90,7 @@
*
* @param resourcePath the path of the resource
* @param resourceContent the content of resource
- * @exception IOException accessing the resource failed
+ * @exception IOException accessing the resource failed
*/
void update( String resourcePath, Object resourceContent )
throws IOException;
@@ -101,7 +103,7 @@
* @exception IOException accessing the resource failed
*/
boolean delete( String resourcePath )
- throws IOException;
+ throws IOException;
/////////////////////////////////////////////////////////////////////////
// Locator Functionality
@@ -131,17 +133,17 @@
* @param context the context to locate the resource
* @param resourceName the name of the resource
* @return the content of the resource
- * @exception IOException accessing the resource failed
+ * @exception IOException accessing the resource failed
*/
byte[] read( String[] context, String resourceName )
throws IOException;
/**
- * Get the implementation specific URL of the
+ * Get the implementation specific URL of the
* underlying resource. Be aware that this method
* breaks our abstraction but is required lets
* say for a XSL to include other stylesheets.
- *
+ *
* @param context the context to locate the resource
* @param resourceName the name of the resource
* @return the name of the resource or null
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManagerService.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManagerService.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManagerService.java (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManagerService.java Fri May 4 23:58:06 2007
@@ -1,20 +1,22 @@
package org.apache.fulcrum.resourcemanager;
/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
import java.io.IOException;
@@ -34,14 +36,14 @@
/**
* List all available domains.
- *
+ *
* @return list of all available domains
*/
String[] listDomains();
-
+
/**
* List all avaible resources recursivelyfor a given domain.
- *
+ *
* @param domain the domain you are interested in
* @return list of all available resources for the domain
*/
@@ -63,7 +65,7 @@
* @return true if the resource exists
*/
boolean exists( String domain, String resourcePath );
-
+
/**
* Saves a file.
*
@@ -82,7 +84,7 @@
*/
byte[] read( String domain, String resourcePath )
throws IOException;
-
+
/**
* Updates a given resource
*
@@ -118,7 +120,7 @@
/**
* Get the resource name.
- *
+ *
* @param domain the domain you are interested in
* @param context the context to locate the resource
* @param resourceName the name of the resource
@@ -130,7 +132,7 @@
* Loads a resource.
*
* @param domain the domain you are interested in
- * @param context the context to locate the resource
+ * @param context the context to locate the resource
* @param resourceName the name of the resource
*/
byte[] read( String domain, String[] context, String resourceName )
@@ -138,7 +140,7 @@
/**
* Get the implementation specific URL of the underlying resource.
- *
+ *
* @param domain the domain you are interested in
* @param context the context to locate the resource
* @param resourceName the name of the resource
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java Fri May 4 23:58:06 2007
@@ -1,20 +1,22 @@
package org.apache.fulcrum.resourcemanager.impl;
/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
import java.io.BufferedInputStream;
@@ -52,40 +54,40 @@
public abstract class BaseResourceManager
extends AbstractLogEnabled
- implements Contextualizable, Serviceable, Configurable,
+ implements Contextualizable, Serviceable, Configurable,
Initializable, Disposable, Reconfigurable, ResourceManager
{
/** the buffer size for copying streams */
private static final int BUF_SIZE = 1024;
-
+
/** The context supplied by the avalon framework */
private Context context;
-
+
/** The service manager supplied by the avalon framework */
private ServiceManager serviceManager;
-
+
/** The configuraton supplied by the avalon framework */
private Configuration configuration;
-
+
/** the Avalon application directory */
private File applicationDir;
/** the Avalon temp directory */
private File tempDir;
-
+
/** the name of the domain */
private String domain;
/** the seed to generate the password */
private String seed;
-
+
/** use transparent encryption/decryption */
- private String useEncryption;
-
+ private String useEncryption;
+
/////////////////////////////////////////////////////////////////////////
// Avalon Service Lifecycle Implementation
/////////////////////////////////////////////////////////////////////////
-
+
/**
* Constructor
*/
@@ -93,7 +95,7 @@
{
// nothing to do
}
-
+
/**
* @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
*/
@@ -111,7 +113,7 @@
{
this.serviceManager = serviceManager;
}
-
+
/**
* @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
*/
@@ -121,7 +123,7 @@
this.setDomain( configuration.getAttribute("name") );
this.seed = "resourcemanager";
}
-
+
/**
* @see org.apache.avalon.framework.activity.Initializable#initialize()
*/
@@ -129,7 +131,7 @@
{
// nothing to do
}
-
+
/**
* @see org.apache.avalon.framework.activity.Disposable#dispose()
*/
@@ -141,7 +143,7 @@
this.domain = null;
this.seed = null;
this.serviceManager = null;
- this.tempDir = null;
+ this.tempDir = null;
}
/**
@@ -152,7 +154,7 @@
{
this.configure(configuration);
}
-
+
/////////////////////////////////////////////////////////////////////////
// Service Implementation
/////////////////////////////////////////////////////////////////////////
@@ -164,7 +166,7 @@
{
return this.configuration;
}
-
+
/**
* @return Returns the context.
*/
@@ -172,7 +174,7 @@
{
return this.context;
}
-
+
/**
* @return Returns the serviceManager.
*/
@@ -180,7 +182,7 @@
{
return this.serviceManager;
}
-
+
/**
* @return Returns the applicationDir.
*/
@@ -188,7 +190,7 @@
{
return applicationDir;
}
-
+
/**
* @return Returns the tempDir.
*/
@@ -196,7 +198,7 @@
{
return tempDir;
}
-
+
/**
* @return Returns the domain.
*/
@@ -204,7 +206,7 @@
{
return domain;
}
-
+
/**
* Get the content as byte[]
*/
@@ -227,10 +229,10 @@
}
else if( content instanceof Properties )
{
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
((Properties) content).store( baos, "Created by fulcrum-resourcemanager-service" );
result = baos.toByteArray();
- }
+ }
else
{
String msg = "Don't know how to read " + content.getClass().getName();
@@ -239,7 +241,7 @@
return result;
}
-
+
/**
* Extract a byte[] from the input stream.
*/
@@ -257,15 +259,15 @@
{
osWriter.write(ch);
}
-
+
osWriter.flush();
data = os.toByteArray();
osWriter.close();
isReader.close();
-
+
return data;
}
-
+
/**
* @param domain The domain to set.
*/
@@ -273,7 +275,7 @@
{
this.domain = domain;
}
-
+
/**
* @return Returns the useEncryption.
*/
@@ -281,7 +283,7 @@
{
return useEncryption;
}
-
+
/**
* @param useEncryption The useEncryption to set.
*/
@@ -289,15 +291,15 @@
{
this.useEncryption = useEncryption;
}
-
- /**
+
+ /**
* @return the instance of the PBEService
*/
protected PBEService getPBEService()
{
String service = PBEService.class.getName();
PBEService result = null;
-
+
if( this.getServiceManager().hasService(service) )
{
try
@@ -316,18 +318,18 @@
String msg = "The PBEService is not registered";
throw new RuntimeException( msg );
}
-
+
return result;
- }
-
- /**
+ }
+
+ /**
* @return the password for the resource manager
*/
private char[] getPassword() throws Exception
{
return this.getPBEService().createPassword( this.seed.toCharArray() );
}
-
+
/**
* Reads the given input stream and decrypts it if required
* @param is the input stream to be read
@@ -361,7 +363,7 @@
byte[] result = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
this.copy(is,baos);
- result = baos.toByteArray();
+ result = baos.toByteArray();
return result;
}
@@ -432,9 +434,9 @@
}
/**
- * Write the given output stream and encrypts it if required. If the
+ * Write the given output stream and encrypts it if required. If the
* encryption mode is "auto" we also encryt it.
- *
+ *
* @param os the output stream to be written
* @param content the content to be written
*/
@@ -465,9 +467,9 @@
throws IOException
{
ByteArrayInputStream bais = new ByteArrayInputStream(content);
- this.copy( bais, os );
+ this.copy( bais, os );
}
-
+
/**
* Write the given file and encrypt it.
* @param target the target file
@@ -497,7 +499,7 @@
throw new IOException( msg );
}
}
-
+
/**
* Pumps the input stream to the output stream.
*
@@ -520,5 +522,5 @@
os.flush();
os.close();
- }
+ }
}
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java Fri May 4 23:58:06 2007
@@ -1,20 +1,22 @@
package org.apache.fulcrum.resourcemanager.impl;
/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
import java.io.File;
@@ -31,7 +33,7 @@
/**
- * Concrete implementation of a file-based resource service. The current
+ * Concrete implementation of a file-based resource service. The current
* implementation caches the location of the available resources. The context
* and resourceName is used to build a relative filename.
*
@@ -42,7 +44,7 @@
{
/** an optinal suffix to filter resources */
private String suffix;
-
+
/** try to locate a resource automagically? */
private boolean useLocator;
@@ -51,21 +53,21 @@
/** the cached list of all available resources */
private String[] resourceFileNameList;
-
+
/** the directory names we usually want to exclude */
private String[] defaultDirectoryExcludes;
-
+
/////////////////////////////////////////////////////////////////////////
// Avalon Service Lifecycle Implementation
/////////////////////////////////////////////////////////////////////////
/**
- * Constructor
+ * Constructor
*/
public FileResourceManager()
- {
+ {
super();
-
+
this.useLocator = true;
this.defaultDirectoryExcludes = new String[] { "CVS", ".svn" };
}
@@ -76,21 +78,21 @@
public void configure(Configuration cfg) throws ConfigurationException
{
super.configure( cfg );
-
+
// the optional suffix - "*" is the usual wildcard suffix
-
+
this.suffix = cfg.getChild(CONFIG_KEY_SUFFIX).getValue("*");
-
+
// try to locate a resources automagically ?
this.useLocator = cfg.getChild(CONFIG_KEY_USELOCATOR).getValueAsBoolean(false);
// are we using encryption/decryption
-
+
this.setUseEncryption(
cfg.getChild(CONFIG_KEY_USEENCRYPTION).getValue("false")
);
-
+
// locate the directory where we the resources are located
String currLocationName = cfg.getChild(CONFIG_KEY_LOCATION).getValue();
@@ -107,18 +109,18 @@
if( this.resourceDir.exists() )
{
- this.getLogger().debug(
- "Using the resource directory : " + this.resourceDir.getAbsolutePath()
- );
+ this.getLogger().debug(
+ "Using the resource directory : " + this.resourceDir.getAbsolutePath()
+ );
}
else
{
- String msg = "The following resource directory is not found : "
+ String msg = "The following resource directory is not found : "
+ this.resourceDir.getAbsolutePath();
-
+
throw new ConfigurationException( msg );
}
-
+
// load the file names of all resources and sort it
@@ -131,13 +133,13 @@
public void dispose()
{
super.dispose();
-
+
this.suffix = null;
this.useLocator = false;
this.resourceDir = null;
this.resourceFileNameList = null;
}
-
+
/**
* @see org.apache.avalon.framework.configuration.Reconfigurable#reconfigure(org.apache.avalon.framework.configuration.Configuration)
*/
@@ -147,18 +149,18 @@
super.reconfigure( configuration );
this.configure(configuration);
}
-
+
/////////////////////////////////////////////////////////////////////////
// Service interface implementation
/////////////////////////////////////////////////////////////////////////
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManager#exists(java.lang.String)
*/
public synchronized boolean exists(String resourceName)
{
File resourceFile = this.findResourceFile( resourceName, this.resourceFileNameList );
-
+
if( resourceFile == null )
{
return false;
@@ -178,7 +180,7 @@
String[] fileList = this.resourceFileNameList;
String[] result = new String[fileList.length];
- // remove the resource directory name
+ // remove the resource directory name
for( int i=0; i< result.length; i++ )
{
@@ -201,22 +203,22 @@
{
File resourceFile = new File( this.getResourceDir(), resourcePath );
this.getLogger().debug( "Creating resource : " + resourceFile.getAbsolutePath() );
- byte[] byteContent = this.getContent( resourceContent);
+ byte[] byteContent = this.getContent( resourceContent);
FileOutputStream fos = new FileOutputStream(resourceFile);
- this.write( fos, byteContent );
+ this.write( fos, byteContent );
fos.flush();
fos.close();
this.createResourceFileNameList();
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManager#read(java.lang.String)
- */
+ */
public synchronized byte[] read( String resourcePath )
throws IOException
{
byte[] result = null;
-
+
File resourceFile = this.findResourceFile( resourcePath, this.resourceFileNameList );
if( resourceFile != null )
@@ -224,7 +226,7 @@
this.getLogger().debug( "Loading the resource : " + resourceFile.getAbsolutePath() );
FileInputStream fis = new FileInputStream(resourceFile);
result = this.read( fis );
- fis.close();
+ fis.close();
return result;
}
else
@@ -243,10 +245,10 @@
{
this.create( resourcePath, resourceContent );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManager#delete(java.lang.String)
- */
+ */
public synchronized boolean delete( String resourcePath )
throws IOException
{
@@ -264,15 +266,15 @@
return result;
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManager#exists(, java.lang.String)
- */
+ */
public synchronized boolean exists( String[] context, String resourceName )
{
return( this.locate(context,resourceName) != null ? true : false );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManager#read(java.lang.String[], java.lang.String)
*/
@@ -282,7 +284,7 @@
String resourceFileName = this.createResourceFileName( context, resourceName );
return this.read( resourceFileName );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManager#locate(java.lang.String[], java.lang.String)
*/
@@ -291,12 +293,12 @@
String result = null;
String resourceDirName = this.getResourceDir().getAbsolutePath();
String resourceFileName = this.createResourceFileName( context, resourceName );
- File resourceFile = this.findResourceFile( resourceFileName, this.resourceFileNameList );
-
+ File resourceFile = this.findResourceFile( resourceFileName, this.resourceFileNameList );
+
if( resourceFile != null )
{
String temp = resourceFile.getAbsolutePath();
-
+
result = temp.substring(
resourceDirName.length()+1,
temp.length()
@@ -304,10 +306,10 @@
result = result.replace( '\\', '/' );
}
-
- return result;
+
+ return result;
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManager#getResourceURL(java.lang.String[], java.lang.String)
*/
@@ -332,21 +334,21 @@
return null;
}
}
-
+
/////////////////////////////////////////////////////////////////////////
// Service Implementation
/////////////////////////////////////////////////////////////////////////
/**
* Check if the given directory name is excluded from the search.
- *
+ *
* @param directory the directory
* @return true if the directory name is excluded
*/
private boolean isDirectoryExcluded( File directory )
{
String directoryName = directory.getName();
-
+
for( int i=0; i<this.defaultDirectoryExcludes.length; i++ )
{
if(this.defaultDirectoryExcludes[i].equals(directoryName))
@@ -354,12 +356,12 @@
return true;
}
}
-
+
return false;
}
-
+
/**
- * Creates a sorted list of resource file names using the user-supplied
+ * Creates a sorted list of resource file names using the user-supplied
* suffix.
*/
private void createResourceFileNameList()
@@ -385,7 +387,7 @@
{
return this.resourceDir;
}
-
+
/**
* Finds the resource file for the given name.
* @param resourceName the script name
@@ -454,7 +456,7 @@
+ fileList[i-1].getAbsolutePath()
);
}
-
+
if( Arrays.binarySearch( resourceList, fileList[i-1].getAbsolutePath() ) >= 0 )
{
result = fileList[i-1];
@@ -484,12 +486,12 @@
for( int i=0; i<list.length; i++ )
{
- // recursive search for all subdirectories
-
+ // recursive search for all subdirectories
+
if( list[i].isDirectory() )
{
// check that the subdirectory is not excluded from the seach
-
+
if( !this.isDirectoryExcluded(list[i]) )
{
this.findAllResources( list[i], suffix, result );
@@ -522,7 +524,7 @@
private String createResourceFileName( String[] context, String resourceName )
{
StringBuffer result = new StringBuffer();
-
+
if( ( context != null ) && ( context.length > 0 ) )
{
for( int i=0; i<context.length; i++ )
@@ -539,9 +541,9 @@
}
}
}
-
+
result.append( resourceName );
-
+
return result.toString();
- }
-}
\ No newline at end of file
+ }
+}
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java Fri May 4 23:58:06 2007
@@ -1,20 +1,22 @@
package org.apache.fulcrum.resourcemanager.impl;
/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
import java.io.IOException;
@@ -50,16 +52,16 @@
{
/** The context supplied by the avalon framework */
private Context context;
-
+
/** The service manager supplied by the avalon framework */
private ServiceManager serviceManager;
-
+
/** the list of domain configurations */
private Configuration[] domainConfigurationList;
-
+
/** The list of registered domains */
private Hashtable domainList;
-
+
/////////////////////////////////////////////////////////////////////////
// Avalon Service Lifecycle Implementation
/////////////////////////////////////////////////////////////////////////
@@ -79,7 +81,7 @@
{
this.context = context;
}
-
+
/**
* @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
*/
@@ -87,7 +89,7 @@
{
this.serviceManager = serviceManager;
}
-
+
/**
* @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
*/
@@ -102,14 +104,14 @@
public void initialize() throws Exception
{
ResourceManager resourceManager = null;
-
+
for( int i=0; i<this.domainConfigurationList.length; i++ )
{
- resourceManager = this.incarnate( domainConfigurationList[i] );
+ resourceManager = this.incarnate( domainConfigurationList[i] );
this.domainList.put( resourceManager.getDomain(), resourceManager );
}
}
-
+
/**
* @see org.apache.avalon.framework.activity.Disposable#dispose()
*/
@@ -117,19 +119,19 @@
{
String[] domainList = this.listDomains();
ResourceManager resourceManager = null;
-
+
for( int i=0; i<domainList.length; i++ )
{
resourceManager = (ResourceManager) this.getResourceManager(domainList[i]);
-
+
if( resourceManager instanceof Disposable )
{
((Disposable) resourceManager).dispose();
}
}
-
+
this.domainList.clear();
-
+
this.context = null;
this.domainList = null;
this.domainConfigurationList = null;
@@ -158,7 +160,7 @@
ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.delete( resourcePath );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#exists(java.lang.String)
*/
@@ -166,7 +168,7 @@
{
return this.getDomainList().containsKey( domain );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#exists(java.lang.String, java.lang.String)
*/
@@ -175,16 +177,16 @@
ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.exists( resourceName );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#exists(java.lang.String, java.lang.String[], java.lang.String)
*/
public boolean exists(String domain, String[]context, String resourceName)
{
- ResourceManager resourceManager = this.getResourceManager(domain);
+ ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.exists( context, resourceName );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#listDomains()
*/
@@ -193,16 +195,16 @@
String key = null;
Enumeration keys = this.getDomainList().keys();
ArrayList result = new ArrayList();
-
+
while( keys.hasMoreElements() )
{
key = (String) keys.nextElement();
result.add( key );
}
-
+
return (String[]) result.toArray( new String[result.size()] );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#listResources(java.lang.String)
*/
@@ -211,27 +213,27 @@
ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.listResources();
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#read(java.lang.String, java.lang.String)
*/
- public byte[] read(String domain, String resourcePath)
+ public byte[] read(String domain, String resourcePath)
throws IOException
{
ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.read( resourcePath );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#update(java.lang.String, java.lang.String, java.lang.Object)
*/
- public void update(String domain, String resourcePath, Object resourceContent)
+ public void update(String domain, String resourcePath, Object resourceContent)
throws IOException
{
ResourceManager resourceManager = this.getResourceManager(domain);
resourceManager.update( resourcePath, resourceContent );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#getResourceURL(java.lang.String, java.lang.String[], java.lang.String)
*/
@@ -240,7 +242,7 @@
ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.getResourceURL( context, resourceName );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#read(java.lang.String, java.lang.String[], java.lang.String)
*/
@@ -250,7 +252,7 @@
ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.read( context, resourceName );
}
-
+
/**
* @see org.apache.fulcrum.resourcemanager.ResourceManagerService#locate(java.lang.String, java.lang.String[], java.lang.String)
*/
@@ -259,11 +261,11 @@
ResourceManager resourceManager = this.getResourceManager(domain);
return resourceManager.locate( context, resourceName );
}
-
+
/////////////////////////////////////////////////////////////////////////
// Service implementation
/////////////////////////////////////////////////////////////////////////
-
+
/**
* @return Returns the domainList.
*/
@@ -271,43 +273,43 @@
{
return domainList;
}
-
- /**
+
+ /**
* Incarnates the concrete resource manager instances
*/
private ResourceManager incarnate( Configuration domainConfiguration )
throws Exception
{
ResourceManager result = null;
-
+
String domainName = domainConfiguration.getAttribute("name");
- String domainType = domainConfiguration.getAttribute("type",FileResourceManager.class.getName());
-
+ String domainType = domainConfiguration.getAttribute("type",FileResourceManager.class.getName());
+
// create an instance dynamically
-
+
this.getLogger().debug( "Creating a resource manager for " + domainName);
-
+
result = this.createResourceManager( domainType, domainName );
-
+
// invoke the lifecycle methods
-
+
Logger currLogger = this.getLogger().getChildLogger(domainName);
-
+
if( result instanceof AbstractLogEnabled )
{
((AbstractLogEnabled) result).enableLogging( currLogger );
}
-
+
if( result instanceof Contextualizable )
{
((Contextualizable) result).contextualize( this.context );
}
-
+
if( result instanceof Serviceable )
{
((Serviceable) result).service( this.serviceManager );
}
-
+
if( result instanceof Configurable )
{
((Configurable) result).configure( domainConfiguration );
@@ -317,10 +319,10 @@
{
((Initializable) result).initialize();
}
-
+
return result;
}
-
+
/**
* Load the given class dynamically and return an instance of it.
* @param clazz the name of the class
@@ -331,7 +333,7 @@
throws Exception
{
ResourceManager result = null;
-
+
try
{
result = (ResourceManager) Class.forName(clazz).newInstance();
@@ -344,7 +346,7 @@
throw new RuntimeException( e.getMessage() );
}
}
-
+
/**
* Get the ResourceManager for the given domain.
* @param domain the name of the domain
@@ -352,16 +354,16 @@
*/
private ResourceManager getResourceManager( String domain )
{
- ResourceManager result = (ResourceManager) this.getDomainList().get(
- domain
+ ResourceManager result = (ResourceManager) this.getDomainList().get(
+ domain
);
-
+
if( result == null )
{
String msg = "The following domain does not exist : " + domain;
- throw new IllegalArgumentException( msg );
+ throw new IllegalArgumentException( msg );
}
-
+
return result;
}
-}
\ No newline at end of file
+}
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/StringUtils.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/StringUtils.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/StringUtils.java (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/StringUtils.java Fri May 4 23:58:06 2007
@@ -1,20 +1,22 @@
package org.apache.fulcrum.resourcemanager.impl;
/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
import java.util.ArrayList;
@@ -23,7 +25,7 @@
/**
* Helper for string manipulations.
- *
+ *
* @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
*/
public class StringUtils
@@ -127,4 +129,4 @@
}
return (String []) list.toArray( new String[list.size()] );
}
-}
\ No newline at end of file
+}
Modified: jakarta/turbine/fulcrum/trunk/resourcemanager/src/test/TestComponentConfig.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/resourcemanager/src/test/TestComponentConfig.xml?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/resourcemanager/src/test/TestComponentConfig.xml (original)
+++ jakarta/turbine/fulcrum/trunk/resourcemanager/src/test/TestComponentConfig.xml Fri May 4 23:58:06 2007
@@ -1,7 +1,25 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<componentConfig>
-
+
<ResourceManagerService>
<domain name="groovy">
<suffix>groovy</suffix>
@@ -18,13 +36,13 @@
<location>./src/test/resources/test</location>
<useLocator>false</useLocator>
<useEncryption>true</useEncryption>
- </domain>
+ </domain>
<domain name="crypto">
<suffix>txt</suffix>
<location>./src/test/resources/crypto</location>
<useLocator>false</useLocator>
<useEncryption>auto</useEncryption>
- </domain>
+ </domain>
</ResourceManagerService>
-
-</componentConfig>
\ No newline at end of file
+
+</componentConfig>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org