ports/86800: New port: java/jakarta-commons-chain "Chain of Responsibility" API
Adam VanderHook
acidos at bandwidth-junkies.net
Sat Oct 1 17:10:22 UTC 2005
>Number: 86800
>Category: ports
>Synopsis: New port: java/jakarta-commons-chain "Chain of Responsibility" API
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Oct 01 17:10:19 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Adam VanderHook
>Release: FreeBSD 5.4-RELEASE-p1 i386
>Organization:
Bandwidth Junkies
>Environment:
System: FreeBSD regen.bandwidth-junkies.net 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #5: Fri May 27 23:26:27 EDT 2005 acidos at regen.bandwidth-junkies.net:/usr/obj/usr/src/sys/REGEN i386
>Description:
The Jakarta Chain API is an implementation of the "Chain of Responsibility" API
from the "Gang of Four" design patterns book.
>How-To-Repeat:
>Fix:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# jakarta-commons-chain
# jakarta-commons-chain/pkg-descr
# jakarta-commons-chain/distinfo
# jakarta-commons-chain/Makefile
#
echo c - jakarta-commons-chain
mkdir -p jakarta-commons-chain > /dev/null 2>&1
echo x - jakarta-commons-chain/pkg-descr
sed 's/^X//' >jakarta-commons-chain/pkg-descr << 'END-of-jakarta-commons-chain/pkg-descr'
XJakarta Commons Chain of Responsiblity library.
X
XThe Chain API models a computation as a series of "commands" that can be
Xcombined into a "chain". The API for a command consists of a single method
X(execute()), which is passed a "context" parameter containing the dynamic state
Xof the computation, and whose return value is a boolean that determines whether
Xor not processing for the current chain has been completed (true), or whether
Xprocessing should be delegated to the next command in the chain (false).
X
XThe "context" abstraction is designed to isolate command implementations from
Xthe environment in which they are run (such as a command that can be used in
Xeither a Servlet or Portlet, without being tied directly to the API contracts
Xof either of these environments). For commands that need to allocate resources
Xprior to delegation, and then release them upon return (even if a delegated-to
Xcommand throws an exception), the "filter" extension to "command" provides a
Xpostprocess() method for this cleanup. Finally, commands can be stored and
Xlooked up in a "catalog" to allow deferral of the decision on which command (or
Xchain) is actually executed.
X
XGiven that command implementations are designed to conform with these
Xrecommendations, it should be feasible to utilize the Chain of Responsibility
XAPIs in the "front controller" of a web application framework (such as Struts),
Xbut also be able to use it in the business logic and persistence tiers to model
Xcomplex computational requirements via composition. In addition, separation of a
Xcomputation into discrete commands that operate on a general purpose context
Xallows easier creation of commands that are unit testable, because the impact of
Xexecuting a command can be directly measured by observing the corresponding
Xstate changes in the context that is supplied.
X
XWWW: http://jakarta.apache.org/commons/chain/
END-of-jakarta-commons-chain/pkg-descr
echo x - jakarta-commons-chain/distinfo
sed 's/^X//' >jakarta-commons-chain/distinfo << 'END-of-jakarta-commons-chain/distinfo'
XMD5 (commons-chain-1.0-src.tar.gz) = 4c0382d53efed19ac0aff29a0662e2b0
XSIZE (commons-chain-1.0-src.tar.gz) = 175485
END-of-jakarta-commons-chain/distinfo
echo x - jakarta-commons-chain/Makefile
sed 's/^X//' >jakarta-commons-chain/Makefile << 'END-of-jakarta-commons-chain/Makefile'
X# New ports collection makefile for: Jakarta Commons Logging
X# Date created: November 14, 2002
X# Whom: Ernst de Haan <znerd at FreeBSD.org>
X#
X# $FreeBSD: ports/java/jakarta-commons-logging/Makefile,v 1.10 2005/05/23 14:18:12 hq Exp $
X#
X
XPORTNAME= commons-chain
XPORTVERSION= 1.0
XCATEGORIES= java devel
XMASTER_SITES= ${MASTER_SITE_APACHE_JAKARTA}
XMASTER_SITE_SUBDIR= ${PORTNAME:S,-,/,}/source
XPKGNAMEPREFIX= jakarta-
XDISTNAME= ${PORTNAME}-${PORTVERSION}-src
X
XMAINTAINER= acidos at bandwidth-junkies.net
XCOMMENT= API implementing Chain of Responsiblity design pattern
X
XUSE_JAVA= yes
XUSE_ANT= yes
XMAKE_ENV+= ANT_INCLUDE_SHARED_JARS=YES
X
X.include <bsd.port.pre.mk>
X
XALL_TARGET= compile
X.if !defined(NOPORTDOCS)
XALL_TARGET+= javadoc
XOTHERDOCS= LICENSE.txt NOTICE.txt
XPORTDOCS= api ${OTHERDOCS}
X.endif
XJARFILE= ${PORTNAME}.jar ${PORTNAME}-api.jar
X#PLIST_FILES= ${JARFILE:S|^|%%JAVAJARDIR%%/|}
X
XWRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
XBUILD_WRKSRC= ${WRKSRC}
X
Xdo-install:
X @${ECHO_MSG} -n ">> Installing JAR as ${JAVAJARDIR}/${PORTNAME}.jar..."
X @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}-${PORTVERSION}.jar ${JAVAJARDIR}/${PORTNAME}.jar
X @${ECHO_MSG} " [ DONE ]"
X
X.if !defined(NOPORTDOCS)
X @${ECHO_MSG} -n ">> Installing documentation in ${DOCSDIR}/..."
X @cd ${WRKSRC}/dist/docs \
X && ${FIND} api -type d -exec ${MKDIR} ${DOCSDIR}/{} \; \
X && ${FIND} api -type f -exec ${INSTALL_DATA} {} ${DOCSDIR}/{} \;
X @${INSTALL_DATA} ${OTHERDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}/
X @${ECHO_MSG} " ${PORTDOCS} [ DONE ]"
X.endif
X
X.include <bsd.port.post.mk>
END-of-jakarta-commons-chain/Makefile
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list