You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(14) |
Mar
(107) |
Apr
(211) |
May
(93) |
Jun
(158) |
Jul
(159) |
Aug
(368) |
Sep
(188) |
Oct
(151) |
Nov
(115) |
Dec
(98) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(25) |
Feb
|
Mar
(33) |
Apr
(28) |
May
(116) |
Jun
(2) |
Jul
(117) |
Aug
(19) |
Sep
(9) |
Oct
(2) |
Nov
|
Dec
(4) |
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(9) |
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
(22) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(267) |
Sep
|
Oct
|
Nov
(6) |
Dec
(512) |
| 2008 |
Jan
(187) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ken G. <kg...@sp...> - 2003-08-27 20:00:33
|
I don't think the code looks too complicated. I think that instead of
return new DefaultPipelineStageErrorHandler();
we should just have
try {
return (IPipelineStageErrorHandler)
ServiceFactory.getService("PipelineStageErrorHandler.default");
} catch (ServiceException se) {
throw new PipelineException(se.getMessage(), se);
}
If that service is not defined, that is an error in the configuration.
It's already defined in service/query.properties.
It works for me!
------------------------------------------------------
I second that - if you have some ideas about how we can make the error
handling configurable - it would be most appreciated.
-----Original Message-----
From: Dejan Krsmanovic [mailto:dej...@nb...]
Sent: Tuesday, August 26, 2003 3:38 AM
To: Babeldoc Developer List
Subject: Re: [Babeldoc-devel] Setting the error handler
I guess you are right that DefaultErrorHandler is ignored. IMO, the
execution should look like this:
- in case of error try to get error handler:
-if there is error handler configured for this stage return it
-if no error handler configured for this stage try to return default
error handler
- error handler shoud try to handle this error
- if error handler returns true, continue with processing. Otherwise, if
error stage is configured for particular stage, it should be processed next.
... snip ...
Ken, do you have some ideas how to improve this code furhter? I don't like
it right now, it looks pretty complicated...
|
|
From: McDonald, B. <Bru...@ba...> - 2003-08-27 19:34:50
|
I second that - if you have some ideas about how we can make the error handling configurable - it would be most appreciated.
-----Original Message-----
From: Dejan Krsmanovic [mailto:dej...@nb...]
Sent: Tuesday, August 26, 2003 3:38 AM
To: Babeldoc Developer List
Subject: Re: [Babeldoc-devel] Setting the error handler
I guess you are right that DefaultErrorHandler is ignored. IMO, the
execution should look like this:
- in case of error try to get error handler:
-if there is error handler configured for this stage return it
-if no error handler configured for this stage try to return default
error handler
- error handler shoud try to handle this error
- if error handler returns true, continue with processing. Otherwise, if
error stage is configured for particular stage, it should be processed next.
I noticed that default error handler is hardcoded and configuration option
in service factory is ignored. Now the problem is how we can guarantee that
some error handler would be returned from getErrorHandler() method? Maybe we
should just throw an exception in case default error handler could not be
obtained. The problem is that this is not something that user would notice
when start babeldoc. It could take a lot of time untill first error occures.
This would mean that user woudn't be aware that configuration is wrong until
first error occued.
The other option that could be possible is that getErrorHandler would first
try to get error handler configured for that stage, then it should try to
obtain default error handler configured in service file, and in case that
fail it should return DefaultPipelineStageErrorHanlder class. This also
could be bad solution since user might think that it is all right, even if
he has not configured PipelineStageErrorHandler.default correctly.
Ken, do you have some ideas how to improve this code furhter? I don't like
it right now, it looks pretty complicated...
Dejan
----- Original Message -----
From: "Ken Geis" <kg...@sp...>
To: <bab...@li...>
Sent: Tuesday, August 26, 2003 3:34 AM
Subject: [Babeldoc-devel] Setting the error handler
> The docs say
>
> > If you want to have some other error handler you can do it by writing
> > your own error handler class. Your class should implement the
> > interface com.babeldoc.core.pipeline.IPipelineStageErrorHandler. You
> > will also need to provide your new error handler Java class to the
> > pipeline configuration.
>
> That last sentence needs to be expanded. It took looking at the code
> for me to figure it out.
>
> So looking at the PipelineStage code, I would need to set errorHandler
> on each pipeline stage in order to override the default error handler.
> I'd like to be able to change one setting and have it be the default
> error handler. Right now, there is an entry in the core
> service/query.properties
>
>
PipelineStageErrorHandler.default=com.babeldoc.core.pipeline.DefaultPipeline
StageErrorHandler
>
> It looks like this setting is ignored (see
PipelineStage.getErrorHandler().)
>
> Am I missing something? How do I do this? Is there some code that
> needs to get written? I'm glad to do it.
>
>
> Ken
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click
here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> Babeldoc-devel mailing list
> Bab...@li...
> https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
Babeldoc-devel mailing list
Bab...@li...
https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
|
|
From: <tr...@us...> - 2003-08-27 03:32:39
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee In directory sc8-pr-cvs1:/tmp/cvs-serv30628/com/babeldoc/j2ee Modified Files: BaseSessionBean.java Log Message: Uh, why didnt I fix the comments, licenses, etc before submitting...?? Index: BaseSessionBean.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/BaseSessionBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BaseSessionBean.java 27 Aug 2003 03:15:30 -0000 1.1 --- BaseSessionBean.java 27 Aug 2003 03:32:32 -0000 1.2 *************** *** 1,23 **** ! /* ! * $Header$ ! * $DateTime: 2002/07/21 17:01:20 $ * * ! * babeldoc: universal document processor ! * Copyright (C) 2002 Bruce McDonald, Elogex Inc. * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation; either version 2 ! * of the License, or (at your option) any later version. * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package com.babeldoc.j2ee; --- 1,66 ---- ! /* ==================================================================== ! * The Apache Software License, Version 1.1 * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. * ! * Redistribution and use in source and binary forms, with or without ! * modification, are permitted provided that the following conditions ! * are met: * ! * 1. Redistributions of source code must retain the above copyright ! * notice, this list of conditions and the following disclaimer. * ! * 2. Redistributions in binary form must reproduce the above copyright ! * notice, this list of conditions and the following disclaimer in ! * the documentation and/or other materials provided with the ! * distribution. ! * ! * 3. The end-user documentation included with the redistribution, ! * if any, must include the following acknowledgment: ! * "This product includes software developed by the ! * Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, ! * if and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Apache" and "Apache Software Foundation" must ! * not be used to endorse or promote products derived from this ! * software without prior written permission. For written ! * permission, please contact ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", ! * nor may "Apache" appear in their name, without prior written ! * permission of the Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ! * SUCH DAMAGE. ! * ==================================================================== ! * ! * This software consists of voluntary contributions made by many ! * individuals on behalf of the Apache Software Foundation. For more ! * information on the Apache Software Foundation, please see ! * <http://www.apache.org/>. ! * ! * Portions of this software are based upon public domain software ! * originally written at the National Center for Supercomputing Applications, ! * University of Illinois, Urbana-Champaign. ! * ==================================================================== ! * ! * Babeldoc: The Universal Document Processor ! * ! * $Header$ ! * $DateTime$ ! * $Author$ * */ package com.babeldoc.j2ee; *************** *** 34,42 **** * parent class to concrete classes in babel. * - * <p>Title: Babel</p> - * <p>Description: Universal Document Processor</p> - * <p>Copyright: Copyright (c) 2002</p> * @author Bmcdonald ! * @version 1.0 */ public class BaseSessionBean --- 77,82 ---- * parent class to concrete classes in babel. * * @author Bmcdonald ! * @version 1.1 */ public class BaseSessionBean |
|
From: <tr...@us...> - 2003-08-27 03:32:39
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/pipeline In directory sc8-pr-cvs1:/tmp/cvs-serv30628/com/babeldoc/j2ee/pipeline Modified Files: EjbClientPipelineStageFactory.java EjbPipelineStageFactoryBean.java Log Message: Uh, why didnt I fix the comments, licenses, etc before submitting...?? Index: EjbClientPipelineStageFactory.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/pipeline/EjbClientPipelineStageFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EjbClientPipelineStageFactory.java 27 Aug 2003 03:15:30 -0000 1.1 --- EjbClientPipelineStageFactory.java 27 Aug 2003 03:32:32 -0000 1.2 *************** *** 96,99 **** --- 96,101 ---- * method getEjbFactory relies on all the configuration information being correct. * + * @author bmcdonald + * @version 1.1 */ public class EjbClientPipelineStageFactory Index: EjbPipelineStageFactoryBean.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/pipeline/EjbPipelineStageFactoryBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EjbPipelineStageFactoryBean.java 27 Aug 2003 03:15:30 -0000 1.1 --- EjbPipelineStageFactoryBean.java 27 Aug 2003 03:32:32 -0000 1.2 *************** *** 1,23 **** ! /* ! * $Header$ ! * $DateTime: 2002/07/24 18:15:55 $ * * ! * babeldoc: universal document processor ! * Copyright (C) 2002 Bruce McDonald, Elogex Inc. * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation; either version 2 ! * of the License, or (at your option) any later version. * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package com.babeldoc.j2ee.pipeline; --- 1,66 ---- ! /* ==================================================================== ! * The Apache Software License, Version 1.1 * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. * ! * Redistribution and use in source and binary forms, with or without ! * modification, are permitted provided that the following conditions ! * are met: * ! * 1. Redistributions of source code must retain the above copyright ! * notice, this list of conditions and the following disclaimer. * ! * 2. Redistributions in binary form must reproduce the above copyright ! * notice, this list of conditions and the following disclaimer in ! * the documentation and/or other materials provided with the ! * distribution. ! * ! * 3. The end-user documentation included with the redistribution, ! * if any, must include the following acknowledgment: ! * "This product includes software developed by the ! * Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, ! * if and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Apache" and "Apache Software Foundation" must ! * not be used to endorse or promote products derived from this ! * software without prior written permission. For written ! * permission, please contact ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", ! * nor may "Apache" appear in their name, without prior written ! * permission of the Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ! * SUCH DAMAGE. ! * ==================================================================== ! * ! * This software consists of voluntary contributions made by many ! * individuals on behalf of the Apache Software Foundation. For more ! * information on the Apache Software Foundation, please see ! * <http://www.apache.org/>. ! * ! * Portions of this software are based upon public domain software ! * originally written at the National Center for Supercomputing Applications, ! * University of Illinois, Urbana-Champaign. ! * ==================================================================== ! * ! * Babeldoc: The Universal Document Processor ! * ! * $Header$ ! * $DateTime$ ! * $Author$ * */ package com.babeldoc.j2ee.pipeline; *************** *** 39,42 **** --- 82,88 ---- * necessary interface methods. It delegates all the pipeline processing to an internal * delegate IPipelineStageFactory. This factory is one of the already defined factories. + * + * @author bmcdonald + * @version 1.1 * * @ejb:bean name="EjbPipelineStageFactory" jndi-name="EjbPipelineStageFactory" type="Stateless" |
|
From: <tr...@us...> - 2003-08-27 03:32:39
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal
In directory sc8-pr-cvs1:/tmp/cvs-serv30628/com/babeldoc/j2ee/journal
Modified Files:
EjbClientJournal.java EjbJournalBean.java EjbJournalTest.java
Log Message:
Uh, why didnt I fix the comments, licenses, etc before submitting...??
Index: EjbClientJournal.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal/EjbClientJournal.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EjbClientJournal.java 27 Aug 2003 03:15:30 -0000 1.1
--- EjbClientJournal.java 27 Aug 2003 03:32:32 -0000 1.2
***************
*** 80,94 ****
* TODO: making this work
*
- * <p>Title: babel</p>
- * <p>Description: universal document processor</p>
- * <p>Copyright: Copyright (c) 2002</p>
* @author bmcdonald
! * @version 1.0
*/
public class EjbClientJournal
implements IJournal {
! /**
! * Bridged object
! */
private EjbJournalRemote journal;
--- 80,90 ----
* TODO: making this work
*
* @author bmcdonald
! * @version 1.1
*/
public class EjbClientJournal
implements IJournal {
!
! /** Bridged object */
private EjbJournalRemote journal;
***************
*** 108,111 ****
--- 104,108 ----
/**
* Get an existing ticket from the string identifier.
+ *
* @param identifier;
* @return the created tracker ticket
***************
*** 122,125 ****
--- 119,123 ----
/**
* Get a ticket for tracking a document.
+ *
* @return the created tracker ticket
*/
***************
*** 152,155 ****
--- 150,154 ----
/**
* Get a ticket for tracking a document from a parent ticket.
+ *
* @param parentTicket the creating ticket
* @return the created tracker ticket
***************
*** 166,169 ****
--- 165,169 ----
/**
* Update a document associated with this ticket
+ *
* @param ticket - the ticket to replay
* @param document the document to update
***************
*** 182,185 ****
--- 182,186 ----
/**
* Update the status of this ticket
+ *
* @param ticket - the ticket for this status
* @param status - the status of the ticket
***************
*** 197,200 ****
--- 198,202 ----
/**
* Replay this ticket from the step
+ *
* @param ticket - the ticket to replay
* @param step - the step to replay from
***************
*** 257,260 ****
--- 259,263 ----
/**
* retrieve the document from the journal for this ticket, step.
+ *
* @param ticket - the ticket to replay
* @param step - the step to replay from
***************
*** 276,281 ****
* @param parent
* @return array of child tickets.
- *
- * @ejb:interface-method view="remote"
*/
public IJournalTicket[] getAllChildTickets(IJournalTicket parent)
--- 279,282 ----
Index: EjbJournalBean.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal/EjbJournalBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EjbJournalBean.java 27 Aug 2003 03:15:30 -0000 1.1
--- EjbJournalBean.java 27 Aug 2003 03:32:32 -0000 1.2
***************
*** 78,82 ****
* EJB Interface for the tracking subsystem. This is meant to provide
* a means to track a document through the system as well as reprocessing
! * opportunities later on
*
* @ejb:bean name="EjbJournal" jndi-name="EjbJournal" type="Stateless"
--- 78,85 ----
* EJB Interface for the tracking subsystem. This is meant to provide
* a means to track a document through the system as well as reprocessing
! * opportunities later on.
! *
! * @author bmcdonald
! * @version 1.1
*
* @ejb:bean name="EjbJournal" jndi-name="EjbJournal" type="Stateless"
***************
*** 88,92 ****
*
* @jboss:resource-ref res-ref-name="jdbc/babelPool" resource-name="jdbc/babelPool"
- *
*/
public class EjbJournalBean
--- 91,94 ----
Index: EjbJournalTest.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal/EjbJournalTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EjbJournalTest.java 27 Aug 2003 03:15:30 -0000 1.1
--- EjbJournalTest.java 27 Aug 2003 03:32:32 -0000 1.2
***************
*** 75,79 ****
* Test the journal functionality.
*/
! public class EjbJournalTest extends TestCase {
IJournal journal;
--- 75,82 ----
* Test the journal functionality.
*/
! public class EjbJournalTest
! extends TestCase {
!
! /** reference to the journal */
IJournal journal;
|
|
From: <tr...@us...> - 2003-08-27 03:32:39
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/resource In directory sc8-pr-cvs1:/tmp/cvs-serv30628/com/babeldoc/j2ee/resource Modified Files: JndiDatasource.java Log Message: Uh, why didnt I fix the comments, licenses, etc before submitting...?? Index: JndiDatasource.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/resource/JndiDatasource.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JndiDatasource.java 27 Aug 2003 03:15:31 -0000 1.1 --- JndiDatasource.java 27 Aug 2003 03:32:32 -0000 1.2 *************** *** 1,23 **** ! /* ! * $Header$ ! * $DateTime: 2002/07/21 17:01:20 $ * * ! * babeldoc: universal document processor ! * Copyright (C) 2002 Bruce McDonald, Elogex Inc. * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation; either version 2 ! * of the License, or (at your option) any later version. * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package com.babeldoc.j2ee.resource; --- 1,66 ---- ! /* ==================================================================== ! * The Apache Software License, Version 1.1 * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. * ! * Redistribution and use in source and binary forms, with or without ! * modification, are permitted provided that the following conditions ! * are met: * ! * 1. Redistributions of source code must retain the above copyright ! * notice, this list of conditions and the following disclaimer. * ! * 2. Redistributions in binary form must reproduce the above copyright ! * notice, this list of conditions and the following disclaimer in ! * the documentation and/or other materials provided with the ! * distribution. ! * ! * 3. The end-user documentation included with the redistribution, ! * if any, must include the following acknowledgment: ! * "This product includes software developed by the ! * Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, ! * if and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Apache" and "Apache Software Foundation" must ! * not be used to endorse or promote products derived from this ! * software without prior written permission. For written ! * permission, please contact ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", ! * nor may "Apache" appear in their name, without prior written ! * permission of the Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ! * SUCH DAMAGE. ! * ==================================================================== ! * ! * This software consists of voluntary contributions made by many ! * individuals on behalf of the Apache Software Foundation. For more ! * information on the Apache Software Foundation, please see ! * <http://www.apache.org/>. ! * ! * Portions of this software are based upon public domain software ! * originally written at the National Center for Supercomputing Applications, ! * University of Illinois, Urbana-Champaign. ! * ==================================================================== ! * ! * Babeldoc: The Universal Document Processor ! * ! * $Header$ ! * $DateTime$ ! * $Author$ * */ package com.babeldoc.j2ee.resource; *************** *** 36,46 **** /** ! * Version of IResource to use when running in a J2EE container * - * <p>Title: Babel</p> - * <p>Description: Universal Document Processor</p> - * <p>Copyright: Copyright (c) 2002</p> * @author Bmcdonald ! * @version 1.0 */ public class JndiDatasource --- 79,86 ---- /** ! * Version of IResource to use to access DataSources using jndi. * * @author Bmcdonald ! * @version 1.1 */ public class JndiDatasource |
|
From: <tr...@us...> - 2003-08-27 03:32:39
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/module
In directory sc8-pr-cvs1:/tmp/cvs-serv30628/com/babeldoc/j2ee/module
Modified Files:
J2eeModule.java
Log Message:
Uh, why didnt I fix the comments, licenses, etc before submitting...??
Index: J2eeModule.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/module/J2eeModule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** J2eeModule.java 27 Aug 2003 03:15:30 -0000 1.1
--- J2eeModule.java 27 Aug 2003 03:32:32 -0000 1.2
***************
*** 73,80 ****
/**
! * This is the MODULE module - please look around but dont touch.
*
* @author bmcdonald
! * @version 1.0
*/
public class J2eeModule extends BabeldocModule {
--- 73,80 ----
/**
! * This is the j2ee module - it doesnt do very much except support the dependsOn.
*
* @author bmcdonald
! * @version 1.1
*/
public class J2eeModule extends BabeldocModule {
|
|
From: <tr...@us...> - 2003-08-27 03:24:44
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/config/service In directory sc8-pr-cvs1:/tmp/cvs-serv29481 Modified Files: config.properties Log Message: Fixed the service configuration and added the journal classes. Index: config.properties =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/j2ee/config/service/config.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.properties 27 Aug 2003 03:15:29 -0000 1.1 --- config.properties 27 Aug 2003 03:24:34 -0000 1.2 *************** *** 2,6 **** # This is the ejb pipeline stage factory. It is intended to be run in an # application container. ! PipelineStageFactory.ejb=com.babeldoc.core.pipeline.simple.SimplePipelineStageFactory # --- 2,6 ---- # This is the ejb pipeline stage factory. It is intended to be run in an # application container. ! PipelineStageFactory.ejb=com.babeldoc.j2ee.pipeline.EjbPipelineStageFactoryBean # *************** *** 8,10 **** # ejb pipeline stage factory. This can be run either from outside the # container or even from within the container. ! PipelineStageFactory.ejbclient=com.babeldoc.core.pipeline.xml.XmlPipelineStageFactory --- 8,17 ---- # ejb pipeline stage factory. This can be run either from outside the # container or even from within the container. ! PipelineStageFactory.ejbclient=com.babeldoc.j2ee.pipeline.xml.EjbClientPipelineStageFactory ! ! # ! # This is the ejb journal - embeddable in an application server ! Journal.ejb=com.babeldoc.j2ee.journal.EjbJournalBean ! ! # Client proxy to an ejb journal - clients talk to this class, this delegates to ejbJournal ! Journal.ejbclient=com.babeldoc.j2ee.journal.EjbClientJournal |
|
From: <tr...@us...> - 2003-08-27 03:15:37
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/scanner/worker In directory sc8-pr-cvs1:/tmp/cvs-serv27662/src/com/babeldoc/j2ee/scanner/worker Added Files: JmsScanner.java Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: JmsScanner.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/scanner/worker/JmsScanner.java,v 1.1 2003/08/27 03:15:31 triphop Exp $ * $DateTime$ * $Author: triphop $ * */ package com.babeldoc.j2ee.scanner.worker; import com.babeldoc.core.LogService; import com.babeldoc.core.option.IConfigInfo; import com.babeldoc.core.option.ConfigOption; import com.babeldoc.core.option.IConfigOptionType; import com.babeldoc.scanner.ScannerException; import com.babeldoc.scanner.ScannerWorker; import com.babeldoc.scanner.ScannerWorkerInfo; import javax.jms.*; import javax.naming.Context; import javax.naming.InitialContext; import java.util.*; /** * JMS Queue scanner. THIS IS COMPLETELY UNTESTED CODE * * @author Bmcdonald * @version 1.1 */ public class JmsScanner extends ScannerWorker { /** Constants */ public final static String Q_FACTORY_NAME = "queueFactoryName"; public final static String Q_NAME = "queueName"; /** configuration information object */ private IConfigInfo info; QueueConnection connection; Queue queue; QueueSession queueSession; Context context; public static final int BYTE_BUFFER = 256; /** * Setup the options. Each of the options lives in the hashtable held * by the superclass * */ public void initialize() { String ConnectionFactory = getInfo().getStrValue(Q_FACTORY_NAME); String Queue = getInfo().getStrValue(Q_NAME); // Set up the jms stuff try { context = new InitialContext(); QueueConnectionFactory connectionFactory = (QueueConnectionFactory) context.lookup(ConnectionFactory); connection = connectionFactory.createQueueConnection(); queueSession = connection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE); queue = (Queue) context.lookup(Queue); } catch (Exception e) { LogService.getInstance().logError(e); } finally { try { connection.close(); queueSession.close(); context.close(); } catch (Exception e) { LogService.getInstance().logError(e); } } } /** * release the held resource. Do nothing - no held resources. */ public void relinquishResources() { LogService.getInstance().logInfo("relinquishResources"); try { connection.close(); queueSession.close(); context.close(); } catch (Exception e) { LogService.getInstance().logError("[relinquishResources]", e); } } /** * Get the information object * * @return information object */ public IConfigInfo getInfo() { if(info==null) { /** * informational class for the ExternalApplicationScanner. */ info = new ScannerWorkerInfo() { public String getDescription() { return "JMS Scanner"; } public String getName() { return "JmsScanner"; } public Collection getTypeSpecificOptions() { ArrayList options = new ArrayList(); //add specific options options.add(new ConfigOption(Q_FACTORY_NAME, IConfigOptionType.STRING, null, true, "JMS Queue factory name")); options.add(new ConfigOption(Q_NAME, IConfigOptionType.STRING, null, true, "JMS Queue name")); return options; } }; } return info; } /** * Do the scan - pull the documents from the JMS queue and submit this * * @throws ScannerException */ public void doScan() throws ScannerException { QueueReceiver receiver = null; try { // Create a QueueReceiver. receiver = queueSession.createReceiver(queue); connection.start(); while (true) { Message m = receiver.receive(1); if (m != null) { handleMessage(m); } } } catch (Exception e) { LogService.getInstance().logError("[doScan]", e); } finally { try { receiver.close(); } catch (Exception e) { LogService.getInstance().logError("[doScan]", e); } } } /** * Only handles text messages at the moment. * * @param m * @throws JMSException */ private void handleMessage(Message m) throws JMSException { Map map = handleMessageMap(m); if (m instanceof TextMessage) { enqueue(((TextMessage)m).getText().getBytes(), map); } else if(m instanceof BytesMessage) { // Not implemented } } /** * Get the message map off the message. * * @param m the message in question * @return message map * * @throws JMSException */ private Map handleMessageMap(Message m) throws JMSException { Map map = new HashMap(); for(Enumeration e = m.getPropertyNames(); e.hasMoreElements();) { String name = (String)e.nextElement(); String value = null; try { value = m.getStringProperty(name); } catch (JMSException e1) { LogService.getInstance().logError(e1); } map.put(name, value); } return map; } } |
|
From: <tr...@us...> - 2003-08-27 03:15:36
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/resource
In directory sc8-pr-cvs1:/tmp/cvs-serv27662/src/com/babeldoc/j2ee/resource
Added Files:
JndiDatasource.java
Log Message:
Re-adding of the J2ee module. THe most you can say about this is that it compiles.
--- NEW FILE: JndiDatasource.java ---
/*
* $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/resource/JndiDatasource.java,v 1.1 2003/08/27 03:15:31 triphop Exp $
* $DateTime: 2002/07/21 17:01:20 $
*
*
* babeldoc: universal document processor
* Copyright (C) 2002 Bruce McDonald, Elogex Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.babeldoc.j2ee.resource;
import com.babeldoc.core.resource.Resource;
import com.babeldoc.core.resource.ResourceException;
import com.babeldoc.core.resource.ResourceConfigInfo;
import com.babeldoc.core.option.IConfigInfo;
import com.babeldoc.core.GeneralException;
import com.babeldoc.j2ee.ServiceLocator;
import java.sql.Connection;
import java.util.Collection;
import javax.sql.DataSource;
/**
* Version of IResource to use when running in a J2EE container
*
* <p>Title: Babel</p>
* <p>Description: Universal Document Processor</p>
* <p>Copyright: Copyright (c) 2002</p>
* @author Bmcdonald
* @version 1.0
*/
public class JndiDatasource
extends Resource {
/** Config option name */
public static String JNDI_NAME = "datasourceName";
public static final String NAMING_URL = "namingUrl";
public static final String NAMING_PROVIDER = "namingProvider";
/** service locator object - could be the global or could be specific */
private ServiceLocator locator;
/** name of the pool */
private String poolName;
/** configuration information object */
private IConfigInfo info;
/**
* Does lazy init of DataSource lookup (expensive operation).
* @return datasource the datasource object
* @throws GeneralException
*/
protected DataSource getDataSource()
throws GeneralException {
return locator.getDataSource(poolName);
}
/**
* Setup the resource - this MUST be overridden by child resources
*
* @throws ResourceException
*/
protected void setup()
throws ResourceException {
poolName = getInfo().getStrValue(JNDI_NAME);
String namingUrl = getInfo().getStrValue(NAMING_URL);
String namingProvider = getInfo().getStrValue(NAMING_PROVIDER);
if(namingUrl!=null&&namingProvider!=null) {
try {
locator = new ServiceLocator(namingUrl, namingProvider);
} catch (GeneralException e) {
throw new ResourceException("", e);
}
} else {
locator = ServiceLocator.getGlobal();
}
}
/**
* Get a new connection.
* @return the connection
* @throws ResourceException
*/
public synchronized Object checkOut()
throws ResourceException {
try {
return getDataSource().getConnection();
} catch (Exception e ) {
throw new ResourceException("[ResourceException.checkOut], e");
}
}
/**
* Checkin this connection
* @param object the connection to check back in
* @throws ResourceException
*/
public synchronized void checkIn(Object object)
throws ResourceException {
try {
((Connection)object).close();
} catch (Exception e ) {
throw new ResourceException("[ResourceException.checkIn]", e);
}
}
/**
* Get the configuration iformation for this class
*
* @return IConfigInfo object
*/
public IConfigInfo getInfo() {
if(info==null) {
info = new ResourceConfigInfo() {
/**
* This method returns type specific options
*
* @return comments
*/
public Collection getTypeSpecificOptions() {
return null;
}
/**
* Return description of this worker
*
* @return description
*/
public String getDescription() {
return null;
}
/**
* return the name
*
* @return
*/
public String getName() {
return null;
}
};
}
return info;
}
}
|
|
From: <tr...@us...> - 2003-08-27 03:15:36
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal In directory sc8-pr-cvs1:/tmp/cvs-serv27662/src/com/babeldoc/j2ee/journal Added Files: EjbClientJournal.java EjbJournalBean.java EjbJournalTest.java Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: EjbClientJournal.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal/EjbClientJournal.java,v 1.1 2003/08/27 03:15:30 triphop Exp $ * $DateTime$ * $Author: triphop $ * */ package com.babeldoc.j2ee.journal; import com.babeldoc.core.journal.*; import com.babeldoc.core.journal.query.*; import com.babeldoc.core.pipeline.PipelineDocument; import com.babeldoc.core.LogService; import com.babeldoc.j2ee.ServiceLocator; import java.rmi.RemoteException; /** * ImplEjbJournal - Brige to the EjbJournal from the client code. This code is NOT TESTED * Please do not complain if it breaks!!!!!!! * * TODO: making this work * * <p>Title: babel</p> * <p>Description: universal document processor</p> * <p>Copyright: Copyright (c) 2002</p> * @author bmcdonald * @version 1.0 */ public class EjbClientJournal implements IJournal { /** * Bridged object */ private EjbJournalRemote journal; /** * Constructor */ public EjbClientJournal() { try { String journalName = EjbJournalHome.JNDI_NAME; EjbJournalHome home = (EjbJournalHome)ServiceLocator.getGlobal().getRemoteHome(journalName, EjbJournalHome.class); journal = home.create(); } catch (Exception refx) { LogService.getInstance().logError("[EjbClientPipelineStageFactory]", refx); } } /** * Get an existing ticket from the string identifier. * @param identifier; * @return the created tracker ticket */ public IJournalTicket getTicket(String identifier) throws JournalException { try { return journal.getTicket(identifier); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * Get a ticket for tracking a document. * @return the created tracker ticket */ public IJournalTicket newTicket() throws JournalException { try { return journal.newTicket(); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * Log a message into the log file * * @param ticket * @param stage * @param message * @throws JournalException */ public void logMessage(IJournalTicket ticket, String stage, String message) throws JournalException { try { journal.logMessage(ticket, stage, message); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * Get a ticket for tracking a document from a parent ticket. * @param parentTicket the creating ticket * @return the created tracker ticket */ public IJournalTicket forkTicket(IJournalTicket parentTicket) throws JournalException { try { return journal.forkTicket(parentTicket); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * Update a document associated with this ticket * @param ticket - the ticket to replay * @param document the document to update * @param stage the pipeline stage resulting in this status change */ public void updateDocument(IJournalTicket ticket, PipelineDocument document, String stage) throws JournalException { try { journal.updateDocument(ticket, document, stage); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * Update the status of this ticket * @param ticket - the ticket for this status * @param status - the status of the ticket * @param stage the pipeline stage resulting in this status change */ public void updateStatus(IJournalTicket ticket, IJournalStatus status, String stage) throws JournalException { try { journal.updateStatus(ticket, status, stage); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * Replay this ticket from the step * @param ticket - the ticket to replay * @param step - the step to replay from */ public void replayTicket(IJournalTicket ticket, int step) throws JournalException { try { journal.replayTicket(ticket, step); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * get tickets between the specified dates. Return up to the maxreturned * number of results. * * @param jQuery * @return * @throws JournalException */ public QueryTicket[] getTickets(JournalQuery jQuery) throws JournalException { try { return journal.getTickets(jQuery); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * Get a ticket for tracking a document. * * @return the created tracker ticket */ public IJournalTicket dummyTicket() throws JournalException { try { return journal.dummyTicket(); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * getJournalForTicket. Get all the ticketsteps for the ticket. * * @param ticket number * @return array of querytickets */ public QueryTicket [] getAllTicketSteps(IJournalTicket ticket) throws JournalException { try { return journal.getAllTicketSteps(ticket); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * retrieve the document from the journal for this ticket, step. * @param ticket - the ticket to replay * @param step - the step to replay from * @return * @throws JournalException */ public PipelineDocument getDocumentAtTicketStep(IJournalTicket ticket, int step ) throws JournalException { try { return journal.getDocumentAtTicketStep(ticket, step); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } /** * getChildrenTickets. Get all the tickets which are children of this ticket * * @param parent * @return array of child tickets. * * @ejb:interface-method view="remote" */ public IJournalTicket[] getAllChildTickets(IJournalTicket parent) throws JournalException { try { return journal.getAllChildTickets(parent); } catch (RemoteException remotex) { throw new JournalException("", remotex); } } } --- NEW FILE: EjbJournalBean.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal/EjbJournalBean.java,v 1.1 2003/08/27 03:15:30 triphop Exp $ * $DateTime$ * $Author: triphop $ * */ package com.babeldoc.j2ee.journal; import javax.ejb.CreateException; import com.babeldoc.core.config.*; import com.babeldoc.j2ee.BaseSessionBean; import com.babeldoc.core.journal.*; import com.babeldoc.core.journal.query.QueryTicket; import com.babeldoc.core.journal.query.JournalQuery; import com.babeldoc.core.pipeline.PipelineDocument; /** * EJB Interface for the tracking subsystem. This is meant to provide * a means to track a document through the system as well as reprocessing * opportunities later on * * @ejb:bean name="EjbJournal" jndi-name="EjbJournal" type="Stateless" * @ejb:interface generate="local,remote" extends="javax.ejb.EJBObject" local-extends="javax.ejb.EJBLocalObject" * @ejb:home generate="local,remote" extends="javax.ejb.EJBHome" local-extends="javax.ejb.EJBLocalHome" * @ejb:transaction type="Required" * @ejb:resource-ref res-name="jdbc/babelPool" res-type="javax.sql.Datasource" res-auth="Container" * @ejb:util generate="physical" * * @jboss:resource-ref res-ref-name="jdbc/babelPool" resource-name="jdbc/babelPool" * */ public class EjbJournalBean extends BaseSessionBean implements IJournal { /** Configuration Constants */ public static final String CONFIG_FILENAME = "journal/ejb/config"; public static final String JOURNAL_CLASS = "journalClassname"; /** * Implementing class */ IJournal journal; /** * Get an existing ticket from the string identifier. * @param identifier; * @return the created tracker ticket * * @ejb:interface-method view="both" */ public IJournalTicket getTicket(String identifier) throws JournalException { return journal.getTicket(identifier); } /** * Get a ticket for tracking a document. * * @return the created tracker ticket * * @ejb:interface-method view="both" */ public IJournalTicket dummyTicket() throws JournalException { return journal.dummyTicket(); } /** * Get a ticket for tracking a document. * * @return the created tracker ticket * * @ejb:interface-method view="both" */ public IJournalTicket newTicket() throws JournalException { return journal.newTicket(); } /** * Log a message into the log file * @param stage the stage to log * @param message The message to log * * @ejb:interface-method view="both" */ public void logMessage(IJournalTicket ticket, String stage, String message) throws JournalException { } /** * Get a ticket for tracking a document from a parent ticket. * @param parentTicket the creating ticket * @return the created tracker ticket * * @ejb:interface-method view="both" */ public IJournalTicket forkTicket(IJournalTicket parentTicket) throws JournalException { return journal.forkTicket(parentTicket); } /** * Update a document associated with this ticket * @param ticket - the ticket to replay * @param document the document to update * @param stage the pipeline stage resulting in this status change * * @ejb:interface-method view="remote" */ public void updateDocument(IJournalTicket ticket, PipelineDocument document, String stage) throws JournalException { journal.updateDocument(ticket, document, stage); } /** * Update the status of this ticket * @param ticket - the ticket for this status * @param status - the status of the ticket * @param stage the pipeline stage resulting in this status change * * @ejb:interface-method view="both" */ public void updateStatus(IJournalTicket ticket, IJournalStatus status, String stage) throws JournalException { journal.updateStatus(ticket, status, stage); } /** * Replay this ticket from the step * @param ticket - the ticket to replay * @param step - the step to replay from * * @ejb:interface-method view="both" */ public void replayTicket(IJournalTicket ticket, int step) throws JournalException { journal.replayTicket(ticket, step); } /** * get tickets between the specified dates. Return up to the maxreturned * number of results. * * @param jQuery the number of tickets to query * * @ejb:interface-method view="both" */ public QueryTicket[] getTickets(JournalQuery jQuery) throws JournalException { return journal.getTickets(jQuery); } /** * getJournalForTicket. Get all the ticketsteps for the ticket. * * @param ticket number * @return array of querytickets * * @ejb:interface-method view="both" */ public QueryTicket [] getAllTicketSteps(IJournalTicket ticket) throws JournalException { return journal.getAllTicketSteps(ticket); } /** * retrieve the document from the journal for this ticket, step. * @param ticket - the ticket to replay * @param step - the step to replay from * @return * @throws JournalException * * @ejb:interface-method view="both" */ public PipelineDocument getDocumentAtTicketStep(IJournalTicket ticket, int step ) throws JournalException { return journal.getDocumentAtTicketStep(ticket, step); } /** * getChildrenTickets. Get all the tickets which are children of this ticket * * @param parent * @return array of child tickets. * * @ejb:interface-method view="both" */ public IJournalTicket[] getAllChildTickets(IJournalTicket parent) throws JournalException { return journal.getAllChildTickets(parent); } /** * Not implemented - should be overridden if needed * * @ejb:interface-method view="both" */ public void ejbCreate() throws CreateException { try { IConfig config = ConfigService.getInstance(). getConfig(CONFIG_FILENAME); String journalClass = config.getString(JOURNAL_CLASS); journal = (IJournal)(Class.forName(journalClass).newInstance()); } catch(ClassNotFoundException classx) { throw new CreateException(classx.toString()); } catch(InstantiationException instantx) { throw new CreateException(instantx.toString()); } catch(IllegalAccessException accessx) { throw new CreateException(accessx.toString()); } } } --- NEW FILE: EjbJournalTest.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/journal/EjbJournalTest.java,v 1.1 2003/08/27 03:15:30 triphop Exp $ * $DateTime$ * $Author: triphop $ * */ package com.babeldoc.j2ee.journal; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import com.babeldoc.core.journal.IJournalTicket; import com.babeldoc.core.journal.IJournal; /** * Test the journal functionality. */ public class EjbJournalTest extends TestCase { IJournal journal; /** * Run all the test methods in this class. */ static public void main(String[] args) { junit.textui.TestRunner.run(suite()); } public EjbJournalTest(java.lang.String testName) { super(testName); } public static Test suite() { TestSuite suite = new TestSuite(EjbJournalTest.class); return suite; } protected void setUp() throws Exception { journal = new EjbClientJournal(); } protected void tearDown() throws Exception { } public void testGetTicket() throws Exception { for (int i = 0; i < 100; ++i) { IJournalTicket ticket = journal.newTicket(); } // System.out.println("Ticket: "+ticket); } } |
|
From: <tr...@us...> - 2003-08-27 03:15:36
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/pipeline In directory sc8-pr-cvs1:/tmp/cvs-serv27662/src/com/babeldoc/j2ee/pipeline Added Files: EjbClientPipelineStageFactory.java EjbPipelineStageFactoryBean.java Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: EjbClientPipelineStageFactory.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/pipeline/EjbClientPipelineStageFactory.java,v 1.1 2003/08/27 03:15:30 triphop Exp $ * $DateTime$ * $Author: triphop $ * */ package com.babeldoc.j2ee.pipeline; import com.babeldoc.core.pipeline.*; import com.babeldoc.core.LogService; import com.babeldoc.core.Named; import com.babeldoc.core.journal.IJournalTicket; import com.babeldoc.core.option.IConfigData; import com.babeldoc.core.option.IConfigInfo; import com.babeldoc.core.option.ConfigOption; import com.babeldoc.core.option.IConfigOptionType; import com.babeldoc.j2ee.pipeline.EjbPipelineStageFactoryRemote; import com.babeldoc.j2ee.pipeline.EjbPipelineStageFactoryHome; import com.babeldoc.j2ee.ServiceLocator; import java.rmi.RemoteException; import java.util.Collection; import java.util.ArrayList; /** * This is the client to ejb pipeline stage factory. This is accessed * as a stub to the ejb pipeline stage factory. The order of events is: * * <ol> * <li> PipelineFactory creates this object * <li> It sets the name of the object * <li> It sets the configuration data on the object * <li> Caches it prior to use. * </ol> * This means that we have a completely configured pipeline prior to use. The * method getEjbFactory relies on all the configuration information being correct. * */ public class EjbClientPipelineStageFactory extends Named implements IPipelineStageFactory { /** jndi name of the remote object */ public static final String EJB_NAME = "ejbName"; public static final String NAMING_URL = "namingUrl"; public static final String NAMING_PROVIDER = "namingProvider"; /** EJB Proxy object */ private EjbPipelineStageFactoryRemote ejbFactory; /** configuration information object */ private IConfigInfo info; /** * Set the options. This applies the configuration data * to the local set ONLY - the ejb pipeline factory is going to be * configured in the container! * * @params the options on the pipeline stage factory */ public void setOptions(IConfigData data) { getInfo().applyConfigData(data); } /** * Get all the pipieline stage connections between stages * * @param sourceStage stage or null for all source stages * @param sinkStage stage or null for all sink stages * * @return array of PipelineStageConnection * * @throws PipelineException */ public PipelineStageConnection[] getPipelineStageConnections( String sourceStage, String sinkStage) throws PipelineException { try { return getEjbFactory().getPipelineStageConnections(sourceStage, sinkStage); } catch (RemoteException e) { throw new PipelineException("", e); } } /** * The pipeline stage * * @return a reference to the pipeline stage */ public String[] getAllPipelineStageNames() throws PipelineException { try { return getEjbFactory().getAllPipelineStageNames(); } catch (RemoteException re) { throw new PipelineException("[EjbClientPipelineStageFactory]", re); } } /** * Get the resolver. * * @return a reference to the pipeline stage resolver */ public IPipelineStageResolver getResolver() { try { return getEjbFactory().getResolver(); } catch (RemoteException re) { } return null; } /** * Get the configuration options for the stage from the * ejb pipeline stage factory * * @param stageName stage name * * @return configuration object * * @throws PipelineException */ public IConfigData getConfig(String stageName) throws PipelineException { try { return getEjbFactory().getConfig(stageName); } catch (RemoteException e) { throw new PipelineException("", e); } } /** * Get the entry point into the pipelinestage * * @return the name of the main entry point into the pipeline stage. * * @throws PipelineException */ public String getEntryStageName() throws PipelineException { try { return getEjbFactory().getEntryStageName(); } catch (RemoteException e) { throw new PipelineException("", e); } } /** * Get the name of the next pipeline stage after this one * * @param stageName * * @return next stage name * * @throws PipelineException */ public String getNextPipelineStage(String stageName) throws PipelineException { try { return getEjbFactory().getNextPipelineStage(stageName); } catch (RemoteException e) { throw new PipelineException("", e); } } /** * Must this pipeline stage track its data object * * @param stageName * @return true - track the document */ public boolean isStageTracked(String stageName) throws PipelineException { try { return getEjbFactory().isStageTracked(stageName); } catch (RemoteException re) { throw new PipelineException("", re); } } /** * Process a message * * @param stageName the name of the stage to process this message * @param document the document to process * @param ticket associated with this transaction * @param results the results from the processing * * @throws PipelineException */ public void process(String stageName, PipelineDocument document, IJournalTicket ticket, Collection results) throws PipelineException { try { getEjbFactory().process(stageName, document, ticket, results); } catch (RemoteException re) { throw new PipelineException("", re); } } /** * Get the configuration iformation for this class * * @return IConfigInfo object */ public IConfigInfo getInfo() { if(info==null) { info = new PipelineStageFactoryInfo() { /** * This method returns type specific options * * @return comments */ public Collection getTypeSpecificOptions() { Collection options = new ArrayList(); options.add(new ConfigOption(EJB_NAME, IConfigOptionType.STRING, EjbPipelineStageFactoryHome.JNDI_NAME, false, "The name of the ejb pipeline stage factory to connect to. If not provided, then the name on the HomeInterface will be used instead.")); options.add(new ConfigOption(NAMING_PROVIDER, IConfigOptionType.STRING, null, false, "The class name of the naming provider to use instead of the the default")); options.add(new ConfigOption(NAMING_URL, IConfigOptionType.STRING, null, false, "The url of the naming system to get the to the naming provider")); return options; } /** * Return description of this worker * * @return description */ public String getDescription() { return "Local proxy to the ejb pipeline stage factory"; } /** * return the name * * @return */ public String getName() { return "ejbclient"; } }; } return info; } /** * return reference to the ejb pipeline stage factory. This establishes the * reference is none is set. If the provider factory and url is not null, then * use a specific instance of the ServiceLocator otherwise use the global * instance. * * @return */ public EjbPipelineStageFactoryRemote getEjbFactory() { if(ejbFactory==null) { try { String homeName = getInfo().getStrValue(EJB_NAME); String providerFactory = getInfo().getStrValue(NAMING_PROVIDER); String providerUrl = getInfo().getStrValue(NAMING_URL); ServiceLocator locator = null; if(providerUrl!=null&&providerFactory!=null) { locator = new ServiceLocator(providerUrl, providerFactory); } else { locator = ServiceLocator.getGlobal(); } EjbPipelineStageFactoryHome home = (EjbPipelineStageFactoryHome)locator. getRemoteHome(homeName, EjbPipelineStageFactoryHome.class); this.ejbFactory = home.create(); } catch (Exception e) { LogService.getInstance().logError("", e); } } return ejbFactory; } } --- NEW FILE: EjbPipelineStageFactoryBean.java --- /* * $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/pipeline/EjbPipelineStageFactoryBean.java,v 1.1 2003/08/27 03:15:30 triphop Exp $ * $DateTime: 2002/07/24 18:15:55 $ * * * babeldoc: universal document processor * Copyright (C) 2002 Bruce McDonald, Elogex Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package com.babeldoc.j2ee.pipeline; import com.babeldoc.j2ee.BaseSessionBean; import com.babeldoc.core.journal.IJournalTicket; import com.babeldoc.core.pipeline.*; import com.babeldoc.core.LogService; import com.babeldoc.core.option.IConfigData; import com.babeldoc.core.option.IConfigInfo; import com.babeldoc.core.option.ConfigOption; import java.util.Collection; import java.util.ArrayList; /** * The ejb pipelnie stage factory is an stateless session bean that allows babeldoc * pipelines to be running inside a j2ee application server. This provides all the * necessary interface methods. It delegates all the pipeline processing to an internal * delegate IPipelineStageFactory. This factory is one of the already defined factories. * * @ejb:bean name="EjbPipelineStageFactory" jndi-name="EjbPipelineStageFactory" type="Stateless" * @ejb:interface generate="local,remote" extends="javax.ejb.EJBObject" local-extends="javax.ejb.EJBLocalObject" * @ejb:home generate="local,remote" extends="javax.ejb.EJBHome" local-extends="javax.ejb.EJBLocalHome" * @ejb:transaction type="Required" */ public class EjbPipelineStageFactoryBean extends BaseSessionBean implements IPipelineStageFactory { /** Name of the option for the delegated factory */ public static final String DELEGATED_FACTORY = "delegatedFactory"; /** keep reference to the configuration information object */ private IConfigInfo info; /** pipeline stage factory delegate that does the work */ private IPipelineStageFactory factory; /** * Get the Pipeline stage factory * * @pipeline stage factory */ public IPipelineStageFactory getFactory() { if(factory == null) { String factoryName = getInfo().getStrValue(DELEGATED_FACTORY); try { factory = PipelineFactoryFactory.getPipelineStageFactory(factoryName); } catch (PipelineException e) { LogService.getInstance().logError("[getPipelineStageFactory]", e); } } return factory; } /** * Get all the pipeline stage names in this factory * * @return array of names * * @throws PipelineException * * @ejb:interface-method view="both" */ public String[] getAllPipelineStageNames() throws PipelineException { return getFactory().getAllPipelineStageNames(); } /** * Get the resolver. * * @return a reference to the pipeline stage resolver * * @ejb:interface-method view="both" */ public IPipelineStageResolver getResolver() { return getFactory().getResolver(); } /** * Get the configuration options for the stage * * @param stageName stage name * * @return configuration object * * @throws PipelineException * * @ejb:interface-method view="both" */ public IConfigData getConfig(String stageName) throws PipelineException { return getFactory().getConfig(stageName); } /** * Get the entry point into the pipelinestage * * @return the name of the main entry point into the pipeline stage. * * @throws PipelineException * * @ejb:interface-method view="both" */ public String getEntryStageName() throws PipelineException { return getFactory().getEntryStageName(); } /** * Get the name of the next pipeline stage after this one * * @param stageName * * @return next stage name * * @throws PipelineException * * @ejb:interface-method view="both" */ public String getNextPipelineStage(String stageName) throws PipelineException { return getFactory().getNextPipelineStage(stageName); } /** * Set the options on this pipeline stage factory. This is generally the * point at which your custom pipeline factory steps in and looks through * the options. * * @param configData the configuration data object * * @throws PipelineException * * @ejb:interface-method view="both" */ public void setOptions(IConfigData configData) throws PipelineException { getFactory().setOptions(configData); } /** * Get all the pipieline stage connections between stages * * @param sourceStage stage or null for all source stages * @param sinkStage stage or null for all sink stages * * @return array of PipelineStageConnection * * @throws PipelineException * * @ejb:interface-method view="both" */ public PipelineStageConnection[] getPipelineStageConnections( String sourceStage, String sinkStage) throws PipelineException { return getFactory().getPipelineStageConnections(sourceStage, sinkStage); } /** * Must this pipeline stage track its data object * * @param stageName stage to determine tracking on * * @return true - track the document * * @throws PipelineException * * @ejb:interface-method view="both" */ public boolean isStageTracked(String stageName) throws PipelineException { return getFactory().isStageTracked(stageName); } /** * Process a message * * @param stageName the name of the stage to process this message * @param document the document to process * @param ticket associated with this transaction * @param results the results from the processing * * @throws PipelineException * * @ejb:interface-method view="both" */ public void process(String stageName, PipelineDocument document, IJournalTicket ticket, Collection results) throws PipelineException { getFactory().process(stageName, document, ticket, results); } /** * Set the name of the object * * @ejb:interface-method view="both" */ public void setName(String name) { getFactory().setName(name); } /** * Get the name of the object * * @return the name of the pipelinestage * * @ejb:interface-method view="both" */ public String getName() { return getFactory().getName(); } /** * @return delegated pipeline stage factories configuration information * * @ejb:interface-method view="both" */ public IConfigInfo getDelegatedInfo() { return getFactory().getInfo(); } /** * Get the configuration iformation for this class and not the delegated * pipeline stage configuration information * * @return IConfigInfo object * * @ejb:interface-method view="both" */ public IConfigInfo getInfo() { if(info==null) { info = new PipelineStageFactoryInfo() { /** * This method returns type specific options * * @return comments */ public Collection getTypeSpecificOptions() { Collection specific = new ArrayList(); specific.add(new ConfigOption(DELEGATED_FACTORY, PipelineStageFactoryInfo.PIPELINE_FACTORY_TYPE, null, true, "The name of the pipeline stage factory that will do the processing of the pipeline")); return specific; } /** * Return description of this worker * * @return description */ public String getDescription() { return "Pipeline stage factory running inside the ejb factory"; } /** * return the name * * @return */ public String getName() { return "ejb"; } }; } return info; } } |
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/support In directory sc8-pr-cvs1:/tmp/cvs-serv27662/support Added Files: xdoclet-1.2b4.jar xdoclet-ejb-module-1.2b4.jar xdoclet-jboss-module-1.2b4.jar xdoclet-jmx-module-1.2b4.jar xdoclet-web-module-1.2b4.jar xjavadoc-1.0.jar Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: xdoclet-1.2b4.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xdoclet-ejb-module-1.2b4.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xdoclet-jboss-module-1.2b4.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xdoclet-jmx-module-1.2b4.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xdoclet-web-module-1.2b4.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xjavadoc-1.0.jar --- (This appears to be a binary file; contents omitted.) |
|
From: <tr...@us...> - 2003-08-27 03:15:35
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/module In directory sc8-pr-cvs1:/tmp/cvs-serv27662/src/com/babeldoc/j2ee/module Added Files: J2eeModule.java Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: J2eeModule.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/module/J2eeModule.java,v 1.1 2003/08/27 03:15:30 triphop Exp $ * $DateTime$ * $Author: triphop $ * */ package com.babeldoc.j2ee.module; import com.babeldoc.core.module.BabeldocModule; import java.util.HashSet; import java.util.Set; /** * This is the MODULE module - please look around but dont touch. * * @author bmcdonald * @version 1.0 */ public class J2eeModule extends BabeldocModule { public static final String MODULE = "j2ee"; /** * gui module only depends on core * * @return */ public Set getDependsOn() { Set set = new HashSet(); set.add("core"); return set; } /** * The Name of the module is gui - and dont you forget it! * * @return */ public String getName() { return MODULE; } } |
|
From: <tr...@us...> - 2003-08-27 03:15:34
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee
In directory sc8-pr-cvs1:/tmp/cvs-serv27662/src/com/babeldoc/j2ee
Added Files:
BaseSessionBean.java ServiceLocator.java
Log Message:
Re-adding of the J2ee module. THe most you can say about this is that it compiles.
--- NEW FILE: BaseSessionBean.java ---
/*
* $Header: /cvsroot/babeldoc/babeldoc/modules/j2ee/src/com/babeldoc/j2ee/BaseSessionBean.java,v 1.1 2003/08/27 03:15:30 triphop Exp $
* $DateTime: 2002/07/21 17:01:20 $
*
*
* babeldoc: universal document processor
* Copyright (C) 2002 Bruce McDonald, Elogex Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.babeldoc.j2ee;
import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
/**
* Implementation of the SessionBean interface. Acts a rundimentary
* parent class to concrete classes in babel.
*
* <p>Title: Babel</p>
* <p>Description: Universal Document Processor</p>
* <p>Copyright: Copyright (c) 2002</p>
* @author Bmcdonald
* @version 1.0
*/
public class BaseSessionBean
implements SessionBean {
/**
* Session context - set by container.
*/
protected SessionContext sessionCtx = null;
/**
* Null implementation.
*
* @throws EJBException
* @throws RemoteException
*/
public void ejbCreate()
throws CreateException, RemoteException {
}
/**
* Null implementation.
*
* @throws EJBException
* @throws RemoteException
*/
public void ejbActivate()
throws EJBException, RemoteException {
}
/**
* Null implementation.
*
* @throws EJBException
* @throws RemoteException
*/
public void ejbPassivate()
throws EJBException, RemoteException {
}
/**
* Null implementation.
*
* @throws EJBException
* @throws RemoteException
*/
public void ejbRemove()
throws EJBException, RemoteException {
}
/**
* Set the session context
*
* @param sessionContext the context argument.
*
* @throws EJBException
* @throws RemoteException
*/
public void setSessionContext(SessionContext sessionContext)
throws EJBException, RemoteException {
sessionCtx = sessionContext;
}
}
--- NEW FILE: ServiceLocator.java ---
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any
* kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
* WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
* EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
* OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
* FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that Software is not designed, licensed or intended
* for use in the design, construction, operation or maintenance of
* any nuclear facility.
*/
package com.babeldoc.j2ee;
import com.babeldoc.core.GeneralException;
import com.babeldoc.core.LogService;
import java.util.HashMap;
import java.util.Map;
import java.util.Collections;
import java.util.Hashtable;
import java.net.URL;
import javax.ejb.EJBHome;
import javax.ejb.EJBLocalHome;
import javax.jms.QueueConnectionFactory;
import javax.jms.Queue;
import javax.jms.TopicConnectionFactory;
import javax.jms.Topic;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;
import javax.sql.DataSource;
/**
* This class is an implementation of the Service Locator pattern. It is
* used to looukup resources such as EJBHomes, JMS Destinations, etc.
* This implementation uses the "singleton" strategy and also the "caching"
* strategy.
* This implementation is intended to be used on the web tier and
* not on the ejb tier.
*/
public class ServiceLocator {
private InitialContext ic;
private Map cache; //used to hold references to EJBHomes/JMS Resources for re-use
private static ServiceLocator global;
/**
* Get the global service locator - this is the service locator with not factory
* or url provided explicitly
*
* @return existing (or created new) global service locator
*/
public static synchronized ServiceLocator getGlobal() {
if(global==null) {
try {
global = new ServiceLocator();
} catch (GeneralException e) {
LogService.getInstance().logError(e);
}
}
return global;
}
/**
* Private constructor - setup the cache and the initial context.
*
* @throws GeneralException
*/
public ServiceLocator() throws GeneralException {
try {
ic = new InitialContext();
cache = Collections.synchronizedMap(new HashMap());
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
}
/**
* Private constructor - setup the cache and the initial context.
*
* @throws GeneralException
*/
public ServiceLocator(String url, String factory)
throws GeneralException {
try {
Hashtable env = new Hashtable(5);
env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
env.put(Context.PROVIDER_URL, url);
ic = new InitialContext(env);
cache = Collections.synchronizedMap(new HashMap());
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
}
/**
* will get the ejb Local home factory. If this ejb home factory has already been
* clients need to cast to the type of EJBHome they desire
*
* @return the EJB Home corresponding to the homeName
*/
public EJBLocalHome getLocalHome(String jndiHomeName)
throws GeneralException {
EJBLocalHome home = null;
try {
if (cache.containsKey(jndiHomeName)) {
home = (EJBLocalHome) cache.get(jndiHomeName);
} else {
home = (EJBLocalHome) ic.lookup(jndiHomeName);
cache.put(jndiHomeName, home);
}
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return home;
}
/**
* will get the ejb Remote home factory. If this ejb home factory has already been
* clients need to cast to the type of EJBHome they desire
*
* @return the EJB Home corresponding to the homeName
*/
public EJBHome getRemoteHome(String jndiHomeName, Class className)
throws GeneralException {
EJBHome home = null;
try {
if (cache.containsKey(jndiHomeName)) {
home = (EJBHome) cache.get(jndiHomeName);
} else {
Object objref = ic.lookup(jndiHomeName);
Object obj = PortableRemoteObject.narrow(objref, className);
home = (EJBHome) obj;
cache.put(jndiHomeName, home);
}
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return home;
}
/**
* @return the factory for the factory to get queue connections from
*/
public QueueConnectionFactory getQueueConnectionFactory(String qConnFactoryName)
throws GeneralException {
QueueConnectionFactory factory = null;
try {
if (cache.containsKey(qConnFactoryName)) {
factory = (QueueConnectionFactory) cache.get(qConnFactoryName);
} else {
factory = (QueueConnectionFactory) ic.lookup(qConnFactoryName);
cache.put(qConnFactoryName, factory);
}
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return factory;
}
/**
* @return the Queue Destination to send messages to
*/
public Queue getQueue(String queueName) throws GeneralException {
Queue queue = null;
try {
if (cache.containsKey(queueName)) {
queue = (Queue) cache.get(queueName);
} else {
queue = (Queue) ic.lookup(queueName);
cache.put(queueName, queue);
}
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return queue;
}
/**
* This method helps in obtaining the topic factory
* @return the factory for the factory to get topic connections from
*/
public TopicConnectionFactory getTopicConnectionFactory(String topicConnFactoryName) throws GeneralException {
TopicConnectionFactory factory = null;
try {
if (cache.containsKey(topicConnFactoryName)) {
factory = (TopicConnectionFactory) cache.get(topicConnFactoryName);
} else {
factory = (TopicConnectionFactory) ic.lookup(topicConnFactoryName);
cache.put(topicConnFactoryName, factory);
}
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return factory;
}
/**
* This method obtains the topc itself for a caller
* @return the Topic Destination to send messages to
*/
public Topic getTopic(String topicName) throws GeneralException {
Topic topic = null;
try {
if (cache.containsKey(topicName)) {
topic = (Topic) cache.get(topicName);
} else {
topic = (Topic) ic.lookup(topicName);
cache.put(topicName, topic);
}
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return topic;
}
/**
* This method obtains the datasource itself for a caller
* @return the DataSource corresponding to the name parameter
*/
public DataSource getDataSource(String dataSourceName) throws GeneralException {
DataSource dataSource = null;
try {
if (cache.containsKey(dataSourceName)) {
dataSource = (DataSource) cache.get(dataSourceName);
} else {
dataSource = (DataSource) ic.lookup(dataSourceName);
cache.put(dataSourceName, dataSource);
}
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return dataSource;
}
/**
* @return the URL value corresponding
* to the env entry name.
*/
public URL getUrl(String envName) throws GeneralException {
URL url = null;
try {
url = (URL) ic.lookup(envName);
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return url;
}
/**
* @return the boolean value corresponding
* to the env entry such as SEND_CONFIRMATION_MAIL property.
*/
public boolean getBoolean(String envName)
throws GeneralException {
Boolean bool = null;
try {
bool = (Boolean) ic.lookup(envName);
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return bool.booleanValue();
}
/**
* @return the String value corresponding
* to the env entry name.
*/
public String getString(String envName)
throws GeneralException {
String envEntry = null;
try {
envEntry = (String) ic.lookup(envName);
} catch (NamingException ne) {
throw new GeneralException("", ne);
} catch (Exception e) {
throw new GeneralException("", e);
}
return envEntry;
}
}
|
|
From: <tr...@us...> - 2003-08-27 03:15:33
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27662/lib Added Files: j2ee.jar Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: j2ee.jar --- (This appears to be a binary file; contents omitted.) |
|
From: <tr...@us...> - 2003-08-27 03:15:33
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/config/service In directory sc8-pr-cvs1:/tmp/cvs-serv27662/config/service Added Files: config.properties Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: config.properties --- # # This is the ejb pipeline stage factory. It is intended to be run in an # application container. PipelineStageFactory.ejb=com.babeldoc.core.pipeline.simple.SimplePipelineStageFactory # # This is client side pipeline factory that delegates all calls to the # ejb pipeline stage factory. This can be run either from outside the # container or even from within the container. PipelineStageFactory.ejbclient=com.babeldoc.core.pipeline.xml.XmlPipelineStageFactory |
|
From: <tr...@us...> - 2003-08-27 03:15:33
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/services In directory sc8-pr-cvs1:/tmp/cvs-serv27662/services Added Files: com.babeldoc.core.module.BabeldocModule Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: com.babeldoc.core.module.BabeldocModule --- com.babeldoc.j2ee.module.j2ee.Module |
|
From: <tr...@us...> - 2003-08-27 03:15:32
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/config/env In directory sc8-pr-cvs1:/tmp/cvs-serv27662/config/env Added Files: config.properties Log Message: Re-adding of the J2ee module. THe most you can say about this is that it compiles. --- NEW FILE: config.properties --- # Setup the environment for J2EE applications # You will most likely have to override these settings for your # application server # # These are good for Jboss on local machine java.naming.provider.url=jnp://localhost:1099 java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory # # These are good for weblogic on local machine #java.naming.provider.url=t3://weblogicServer:7001 #java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory # # There are good for websphere on the local machine java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory java.naming.provider.url=corbaloc:iiop:myhost.mycompany.com:2809 |
|
From: <tr...@us...> - 2003-08-27 03:15:32
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee
In directory sc8-pr-cvs1:/tmp/cvs-serv27662
Added Files:
build.properties build.xml
Log Message:
Re-adding of the J2ee module. THe most you can say about this is that it compiles.
--- NEW FILE: build.properties ---
Module = j2ee
Depends = scanner sql
Jarfile = babeldoc_j2ee.jar
ModuleClass = com.babeldoc.J2ee.module.J2eeModule
--- NEW FILE: build.xml ---
<project name="j2ee" basedir="." default="setup">
<property file="build.properties"/>
<property name="module_name" value="babeldoc_${Module}"/>
<property name="module_path" value="${build}"/>
<target
name="clean">
<echo message="Cleaning ${Module}"/>
<delete dir="${build}"/>
<delete dir="./gensrc"/>
</target>
<target name="pathsetup">
<path id="everything">
<fileset dir="./lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${base_dir}/build/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="./support">
<include name="*.jar"/>
</fileset>
<pathelement location="${base_dir}/support/ant/lib/junit.jar"/>
</path>
</target>
<!--
Setup the project
-->
<target name="setup"
depends="pathsetup" >
<mkdir dir="./build"/>
</target>
<target
name="ejbdoclet"
depends="pathsetup">
<taskdef
name="ejbdoclet"
classname="xdoclet.modules.ejb.EjbDocletTask"
classpathref="everything">
</taskdef>
<ejbdoclet
destdir="gensrc"
excludedtags="@version,@author"
addedtags="@xdoclet-generated at ${TODAY}"
ejbspec="2.0"
>
<fileset dir="src">
<include name="**/*Bean.java"/>
<exclude name="**/BaseSessionBean.java"/>
</fileset>
<remoteinterface pattern="{0}Remote"/>
<localinterface pattern="{0}"/>
<homeinterface />
<localhomeinterface/>
<deploymentdescriptor destdir="build/META-INF"/>
<jboss version="3.0"
securityDomain="java:/jaas/samples"
preferredRelationMapping="relation-table"
datasource="java:/DefaultDS"
datasourcemapping="Hypersonic SQL"
destdir="build/META-INF"
/>
</ejbdoclet>
</target>
<!--
Build the codebase
-->
<target
name="build"
depends="ejbdoclet">
<echo message="Building ${Module}"/>
<javac
destdir="${module_path}"
deprecation="${compile.deprecation}"
debug="${compile.debug}"
classpathref="everything">
<src path="./src"/>
<src path="./gensrc"/>
</javac>
<!-- Copy the configuration files to build/core/... -->
<mkdir dir="${module_path}/${Module}"/>
<copy toDir="${module_path}/${Module}">
<fileset dir="config">
<include name="*/**"/>
</fileset>
</copy>
<!-- copy over the services file -->
<mkdir dir="${module_path}/META-INF/services"/>
<copy toDir="${module_path}/META-INF/services">
<fileset dir="services"/>
</copy>
<jar
jarfile="${base_dir}/build/lib/${Jarfile}"
basedir="${module_path}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<section name="Babeldoc">
<attribute name="Module" value="${Module}"/>
<attribute name="Depends" value="${Depends}"/>
<attribute name="ModuleClass" value="${ModuleClass}"/>
</section>
</manifest>
</jar>
<copy toDir="${base_dir}/build">
<fileset dir=".">
<include name="examples/**"/>
<include name="lib/**"/>
</fileset>
</copy>
</target>
<target
name="deploy">
<echo message="Deploying ${Module}"/>
</target>
<target
name="test">
<echo message="Testing ${Module}"/>
</target>
<target name="format">
<!--
<echo message="Formatting ${Module}"/>
<jalopy fileformat="${jalopy.fileformat}"
convention="${jalopy.convention}"
history="${jalopy.history}"
loglevel="${jalopy.loglevel}"
threads="${jalopy.threads}">
<fileset dir="./src">
<include name="**/*.java" />
</fileset>
</jalopy>
-->
</target>
</project>
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline
In directory sc8-pr-cvs1:/tmp/cvs-serv27423/src/com/babeldoc/core/pipeline
Modified Files:
IPipelineStageFactory.java PipelineFactory.java
PipelineStageFactory.java
Added Files:
PipelineStageFactoryInfo.java
Log Message:
Now pipeline stage factories get to be IConfigurable too!! This is to support the work I am doing in the J2ee module.
--- NEW FILE: PipelineStageFactoryInfo.java ---
package com.babeldoc.core.pipeline;
import com.babeldoc.core.option.*;
import com.babeldoc.core.pipeline.processor.IPipelineStageProcessor;
import com.babeldoc.core.pipeline.processor.PipelineStageProcessorFactory;
import java.util.Collection;
import java.util.ArrayList;
/**
* Pipeline stage factory configuration options.
*
* @author bmcdonald
* @version 1.1
*/
abstract public class PipelineStageFactoryInfo
extends ConfigInfo{
/** Service type for pipeline stages */
public static final ServiceTypeConfigOptionType PIPELINE_FACTORY_TYPE =
new ServiceTypeConfigOptionType(PipelineStageFactoryType.SERVICE_PREFIX);
/** Service type for processor stages */
public static final ServiceTypeConfigOptionType PROCESSOR_TYPE =
new ServiceTypeConfigOptionType(PipelineStageProcessorFactory.SERVICE_PROCESSOR);
/**
* This method returns options that are general to all components
*
* @return comments
*/
public Collection getGeneralOptions() {
Collection general = new ArrayList();
//adding general scanner options
general.add(new ConfigOption(PipelineFactory.TYPE,
PIPELINE_FACTORY_TYPE, null, true, "Pipeline type"));
// This is the type description of the complex type - it consist
// of just one kind of subtype - the <variable>=<value> and is
// passed verbatim to the processor factory
IConfigOptionType processorType = new ComplexConfigOptionType(
new ConfigOption[] { new ConfigOption(PipelineStageProcessorFactory.PROCESSOR_TYPE,
PROCESSOR_TYPE, "Processor type")});
general.add(new ConfigOption(IPipelineStageProcessor.PROCESSOR,
processorType, null, false, "The processor configuration options"));
return general;
}
/**
* Return an xmlized version of the of the config info
*
* @return String of configuration information.
*/
public String toXml() {
return null;
}
}
Index: IPipelineStageFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/IPipelineStageFactory.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** IPipelineStageFactory.java 12 Aug 2003 23:44:44 -0000 1.10
--- IPipelineStageFactory.java 27 Aug 2003 03:13:35 -0000 1.11
***************
*** 68,71 ****
--- 68,72 ----
import com.babeldoc.core.INamed;
import com.babeldoc.core.option.IConfigData;
+ import com.babeldoc.core.option.IConfigurable;
import com.babeldoc.core.journal.IJournalTicket;
***************
*** 75,80 ****
/**
* IPipelineStageFactory - A factory / manager for pipeline stages. This is one of hte
! * most important classes in babeldoc and its handling of the pipelines.
! *
*
* @author Bmcdonald
--- 76,82 ----
/**
* IPipelineStageFactory - A factory / manager for pipeline stages. This is one of hte
! * most important classes in babeldoc and its handling of the pipelines. This interface
! * extends IConfigurable which means that there is a getInfo method which allows for
! * implementing classes to describe all the applicable configuration options.
*
* @author Bmcdonald
***************
*** 82,86 ****
*/
public interface IPipelineStageFactory
! extends INamed {
/**
* Get all the pipeline stage names in this factory
--- 84,88 ----
*/
public interface IPipelineStageFactory
! extends INamed, IConfigurable {
/**
* Get all the pipeline stage names in this factory
***************
*** 92,96 ****
public String[] getAllPipelineStageNames()
throws PipelineException;
-
/**
--- 94,97 ----
Index: PipelineFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/PipelineFactory.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PipelineFactory.java 12 Aug 2003 23:44:44 -0000 1.11
--- PipelineFactory.java 27 Aug 2003 03:13:35 -0000 1.12
***************
*** 89,93 ****
* @version 1.0
*/
! public class PipelineFactory implements IPipelineFactory {
/** constants for the configuration stuff */
public static final String CONFIG_NAME = "pipeline/config";
--- 89,94 ----
* @version 1.0
*/
! public class PipelineFactory
! implements IPipelineFactory {
/** constants for the configuration stuff */
public static final String CONFIG_NAME = "pipeline/config";
Index: PipelineStageFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/PipelineStageFactory.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PipelineStageFactory.java 12 Aug 2003 23:44:44 -0000 1.17
--- PipelineStageFactory.java 27 Aug 2003 03:13:35 -0000 1.18
***************
*** 92,103 ****
/** The resolver */
! private IPipelineStageResolver resolver;
/** The logging serving instance */
private LogService log;
- /** Holds the options */
- private IConfigData options;
-
/** reference to the pipeline stage processor */
private IPipelineStageProcessor processor;
--- 92,100 ----
/** The resolver */
! protected IPipelineStageResolver resolver;
/** The logging serving instance */
private LogService log;
/** reference to the pipeline stage processor */
private IPipelineStageProcessor processor;
***************
*** 170,179 ****
throws PipelineException {
! this.options = options;
// Setup the processor
try {
! this.processor = PipelineStageProcessorFactory.getProcessor(this,
! options.getChild(IPipelineStageProcessor.PROCESSOR));
} catch (GeneralException e) {
throw new PipelineException("", e);
--- 167,176 ----
throws PipelineException {
! this.getInfo().applyConfigData(options);
// Setup the processor
try {
! IConfigData processorConfig = options.getChild(IPipelineStageProcessor.PROCESSOR);
! this.processor = PipelineStageProcessorFactory.getProcessor(this, processorConfig);
} catch (GeneralException e) {
throw new PipelineException("", e);
***************
*** 182,194 ****
/**
- * Get the options on this pipeline stage factory
- *
- * @return the options
- */
- public IConfigData getOptions() {
- return this.options;
- }
-
- /**
* Get all the pipieline stage connections between stages
*
--- 179,182 ----
***************
*** 206,225 ****
/**
! * Set the resolver.
! *
! * @param resolver DOCUMENT ME!
! */
! public void setResolver(IPipelineStageResolver resolver) {
! this.resolver = resolver;
! }
!
! /**
! * Get the resolver.
*
* @return a reference to the pipeline stage resolver
*/
! public IPipelineStageResolver getResolver() {
! return resolver;
! }
/**
--- 194,204 ----
/**
! * Get the resolver. If the resolver is null, then extract
! * whatever information from the configuration options to
! * create the resolver.
*
* @return a reference to the pipeline stage resolver
*/
! abstract public IPipelineStageResolver getResolver();
/**
***************
*** 261,265 ****
* @return log service!
*/
! protected com.babeldoc.core.LogService getLog() {
if (log == null) {
log = LogService.getInstance(this.getClass().getName());
--- 240,244 ----
* @return log service!
*/
! protected LogService getLog() {
if (log == null) {
log = LogService.getInstance(this.getClass().getName());
***************
*** 269,272 ****
--- 248,257 ----
}
+ /**
+ * Get the processor. This has already been setup correctly in the
+ * setOptions method.
+ *
+ * @return
+ */
public IPipelineStageProcessor getProcessor() {
return processor;
|
|
From: <tr...@us...> - 2003-08-27 03:13:42
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv27423/src/com/babeldoc/core/pipeline/simple
Modified Files:
SimplePipelineStageFactory.java
Log Message:
Now pipeline stage factories get to be IConfigurable too!! This is to support the work I am doing in the J2ee module.
Index: SimplePipelineStageFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/simple/SimplePipelineStageFactory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SimplePipelineStageFactory.java 12 Aug 2003 23:44:44 -0000 1.6
--- SimplePipelineStageFactory.java 27 Aug 2003 03:13:35 -0000 1.7
***************
*** 68,75 ****
import com.babeldoc.core.config.ConfigService;
import com.babeldoc.core.config.IConfig;
! import com.babeldoc.core.pipeline.IPipelineStageFactory;
! import com.babeldoc.core.pipeline.PipelineStageFactory;
! import com.babeldoc.core.pipeline.PipelineException;
! import com.babeldoc.core.option.IConfigData;
--- 68,76 ----
import com.babeldoc.core.config.ConfigService;
import com.babeldoc.core.config.IConfig;
! import com.babeldoc.core.pipeline.*;
! import com.babeldoc.core.option.*;
!
! import java.util.Collection;
! import java.util.ArrayList;
***************
*** 85,104 ****
extends PipelineStageFactory
implements IPipelineStageFactory {
/** Configuration constants */
public static final String CONFIG_FILENAME = "configFile";
/**
! * Set the options. Extract the name of the configuration file and then do
! * the setup.
*
! * @param options map of configuration options (possibly nested)
*/
! public void setOptions(IConfigData options)
! throws PipelineException{
! super.setOptions(options);
! String configFile = options.getValue(CONFIG_FILENAME);
! IConfig config = ConfigService.getInstance().getConfig(configFile);
! setResolver(new SimplePipelineStageResolver(config));
}
}
--- 86,155 ----
extends PipelineStageFactory
implements IPipelineStageFactory {
+
/** Configuration constants */
public static final String CONFIG_FILENAME = "configFile";
+ /** Keep reference to the configuration information */
+ private IConfigInfo info;
+
/**
! * Get the configuration iformation for this class
*
! * @return IConfigInfo object
*/
! public IConfigInfo getInfo() {
! if(info==null) {
! info = new PipelineStageFactoryInfo() {
! /**
! * This method returns type specific options
! *
! * @return comments
! */
! public Collection getTypeSpecificOptions() {
! Collection specific = new ArrayList();
! specific.add(new ConfigOption(CONFIG_FILENAME, IConfigOptionType.STRING,
! null, true, "Configuration data filename"));
!
! return specific;
! }
!
! /**
! * Return description of this worker
! *
! * @return description
! */
! public String getDescription() {
! return "Simple pipeline stage factory reads its pipeline configuration from configuration objects";
! }
!
! /**
! * return the name
! *
! * @return
! */
! public String getName() {
! return "simple";
! }
! };
! }
!
! return info;
! }
!
! /**
! * Get the resolver. If the resolver is null, then extract
! * whatever information from the configuration options to
! * create the resolver.
! *
! * @return a reference to the pipeline stage resolver
! */
! public IPipelineStageResolver getResolver() {
! if(resolver==null) {
! String configFile = getInfo().getStrValue(CONFIG_FILENAME);
! IConfig config = ConfigService.getInstance().getConfig(configFile);
! resolver = new SimplePipelineStageResolver(config);
! }
! return resolver;
}
}
|
|
From: <tr...@us...> - 2003-08-27 03:13:42
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/xml
In directory sc8-pr-cvs1:/tmp/cvs-serv27423/src/com/babeldoc/core/pipeline/xml
Modified Files:
XmlPipelineStageFactory.java
Log Message:
Now pipeline stage factories get to be IConfigurable too!! This is to support the work I am doing in the J2ee module.
Index: XmlPipelineStageFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/xml/XmlPipelineStageFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** XmlPipelineStageFactory.java 12 Aug 2003 23:44:44 -0000 1.7
--- XmlPipelineStageFactory.java 27 Aug 2003 03:13:35 -0000 1.8
***************
*** 66,75 ****
package com.babeldoc.core.pipeline.xml;
! import com.babeldoc.core.I18n;
! import com.babeldoc.core.option.IConfigData;
! import com.babeldoc.core.pipeline.PipelineException;
import com.babeldoc.core.pipeline.PipelineStageFactory;
import java.io.IOException;
--- 66,79 ----
package com.babeldoc.core.pipeline.xml;
! import com.babeldoc.core.option.IConfigInfo;
! import com.babeldoc.core.option.ConfigOption;
! import com.babeldoc.core.option.IConfigOptionType;
import com.babeldoc.core.pipeline.PipelineStageFactory;
+ import com.babeldoc.core.pipeline.IPipelineStageResolver;
+ import com.babeldoc.core.pipeline.PipelineStageFactoryInfo;
import java.io.IOException;
+ import java.util.Collection;
+ import java.util.ArrayList;
***************
*** 83,116 ****
* @version 1.0
*/
! public class XmlPipelineStageFactory extends PipelineStageFactory {
/** constant: Configuration constants */
public static final String XML_FILENAME = "configFile";
/**
! * Default constructor - necessary for the dynamic loading nature of the
! * pipeline factory.
*/
! public XmlPipelineStageFactory() {
}
/**
! * Set the data. Once the the data have been set we can do the
! * configuration loving.
! *
! * @param data the hashtable of data.
*
! * @throws PipelineException DOCUMENT ME!
*/
! public void setOptions(IConfigData data) throws PipelineException {
! super.setOptions(data);
! String fileName = data.getValue(XML_FILENAME);
! try {
! setResolver(new XmlPipelineStageResolver(fileName));
! } catch (IOException e) {
! throw new PipelineException(I18n.get("002001", fileName), e);
}
}
}
--- 87,161 ----
* @version 1.0
*/
! public class XmlPipelineStageFactory
! extends PipelineStageFactory {
/** constant: Configuration constants */
public static final String XML_FILENAME = "configFile";
+ /** Keep the configuration information */
+ private IConfigInfo info;
+
/**
! * Get the resolver. If the resolver is null, then extract
! * whatever information from the configuration options to
! * create the resolver.
! *
! * @return a reference to the pipeline stage resolver
*/
! public IPipelineStageResolver getResolver() {
! if(resolver==null) {
! String fileName = getInfo().getStrValue(XML_FILENAME);
! try {
! resolver = new XmlPipelineStageResolver(fileName);
! } catch (IOException e) {
! getLog().logError(e);
! }
! }
! return resolver;
}
/**
! * Get the configuration iformation for this class
*
! * @return IConfigInfo object
*/
! public IConfigInfo getInfo() {
! if(info==null) {
! info = new PipelineStageFactoryInfo() {
! /**
! * This method returns type specific options
! *
! * @return comments
! */
! public Collection getTypeSpecificOptions() {
! Collection specific = new ArrayList();
! specific.add(new ConfigOption(XML_FILENAME, IConfigOptionType.STRING,
! null, true, "Configuration data filename"));
! return specific;
! }
!
! /**
! * Return description of this worker
! *
! * @return description
! */
! public String getDescription() {
! return "XML pipeline stage factory reads its pipeline configuration from an xml file";
! }
!
! /**
! * return the name
! *
! * @return
! */
! public String getName() {
! return "xml";
! }
! };
}
+
+ return info;
}
}
|
|
From: <tr...@us...> - 2003-08-27 02:04:44
|
Update of /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/journal/browser In directory sc8-pr-cvs1:/tmp/cvs-serv17001 Modified Files: JournalBrowser.java Log Message: Removed reference to PipelineBuilderFrame - this class has been renamed to ...Panel. Index: JournalBrowser.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/gui/src/com/babeldoc/gui/journal/browser/JournalBrowser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JournalBrowser.java 11 Jun 2003 23:35:38 -0000 1.2 --- JournalBrowser.java 27 Aug 2003 02:04:36 -0000 1.3 *************** *** 66,71 **** package com.babeldoc.gui.journal.browser; - import com.babeldoc.gui.pipeline.builder.PipelineBuilderFrame; - import javax.swing.*; --- 66,69 ---- |
|
From: <tr...@us...> - 2003-08-27 01:35:04
|
Update of /cvsroot/babeldoc/babeldoc/modules/j2ee/config/service In directory sc8-pr-cvs1:/tmp/cvs-serv13228/service Log Message: Directory /cvsroot/babeldoc/babeldoc/modules/j2ee/config/service added to the repository |