pax_global_header 0000666 0000000 0000000 00000000064 11650724173 0014520 g ustar 00root root 0000000 0000000 52 comment=20df06911ef6bc186bd68a4507279d83a5532b9c
netty-netty-d9c3789/ 0000775 0000000 0000000 00000000000 11650724173 0014400 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/.fbfilter.xml 0000664 0000000 0000000 00000002722 11650724173 0017000 0 ustar 00root root 0000000 0000000
netty-netty-d9c3789/.fbprefs 0000664 0000000 0000000 00000020772 11650724173 0016040 0 ustar 00root root 0000000 0000000 #FindBugs User Preferences
#Wed Mar 04 19:28:55 KST 2009
detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
detectorBCPMethodReturnCheck=BCPMethodReturnCheck|true
detectorBadAppletConstructor=BadAppletConstructor|true
detectorBadResultSetAccess=BadResultSetAccess|true
detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true
detectorBadUseOfReturnValue=BadUseOfReturnValue|true
detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
detectorBooleanReturnNull=BooleanReturnNull|true
detectorBuildInterproceduralCallGraph=BuildInterproceduralCallGraph|true
detectorBuildObligationPolicyDatabase=BuildObligationPolicyDatabase|true
detectorCallToUnsupportedMethod=CallToUnsupportedMethod|true
detectorCalledMethods=CalledMethods|true
detectorCheckCalls=CheckCalls|false
detectorCheckExpectedWarnings=CheckExpectedWarnings|false
detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
detectorCheckTypeQualifiers=CheckTypeQualifiers|true
detectorCloneIdiom=CloneIdiom|true
detectorComparatorIdiom=ComparatorIdiom|true
detectorConfusedInheritance=ConfusedInheritance|true
detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
detectorCrossSiteScripting=CrossSiteScripting|true
detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true
detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true
detectorDontUseEnum=DontUseEnum|true
detectorDroppedException=DroppedException|true
detectorDumbMethodInvocations=DumbMethodInvocations|true
detectorDumbMethods=DumbMethods|true
detectorDuplicateBranches=DuplicateBranches|true
detectorEmptyZipFileEntry=EmptyZipFileEntry|true
detectorEqStringTest=EqStringTest|true
detectorEqualsOperandShouldHaveClassCompatibleWithThis=EqualsOperandShouldHaveClassCompatibleWithThis|true
detectorFieldItemSummary=FieldItemSummary|true
detectorFinalizerNullsFields=FinalizerNullsFields|true
detectorFindBadCast=FindBadCast|true
detectorFindBadCast2=FindBadCast2|true
detectorFindBadEqualsImplementation=FindBadEqualsImplementation|true
detectorFindBadForLoop=FindBadForLoop|true
detectorFindBugsSummaryStats=FindBugsSummaryStats|true
detectorFindCircularDependencies=FindCircularDependencies|false
detectorFindDeadLocalStores=FindDeadLocalStores|true
detectorFindDoubleCheck=FindDoubleCheck|true
detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true
detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true
detectorFindFinalizeInvocations=FindFinalizeInvocations|true
detectorFindFloatEquality=FindFloatEquality|true
detectorFindFloatMath=FindFloatMath|false
detectorFindHEmismatch=FindHEmismatch|true
detectorFindInconsistentSync2=FindInconsistentSync2|true
detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true
detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true
detectorFindMaskedFields=FindMaskedFields|true
detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true
detectorFindNakedNotify=FindNakedNotify|true
detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true
detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true
detectorFindNonShortCircuit=FindNonShortCircuit|true
detectorFindNullDeref=FindNullDeref|true
detectorFindNullDerefsInvolvingNonShortCircuitEvaluation=FindNullDerefsInvolvingNonShortCircuitEvaluation|true
detectorFindOpenStream=FindOpenStream|true
detectorFindPuzzlers=FindPuzzlers|true
detectorFindRefComparison=FindRefComparison|true
detectorFindReturnRef=FindReturnRef|true
detectorFindRunInvocations=FindRunInvocations|true
detectorFindSelfComparison=FindSelfComparison|true
detectorFindSelfComparison2=FindSelfComparison2|true
detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true
detectorFindSpinLoop=FindSpinLoop|true
detectorFindSqlInjection=FindSqlInjection|true
detectorFindTwoLockWait=FindTwoLockWait|true
detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true
detectorFindUnconditionalWait=FindUnconditionalWait|true
detectorFindUninitializedGet=FindUninitializedGet|true
detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true
detectorFindUnreleasedLock=FindUnreleasedLock|true
detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|true
detectorFindUnsyncGet=FindUnsyncGet|true
detectorFindUselessControlFlow=FindUselessControlFlow|true
detectorFormatStringChecker=FormatStringChecker|true
detectorHugeSharedStringConstants=HugeSharedStringConstants|true
detectorIDivResultCastToDouble=IDivResultCastToDouble|true
detectorIncompatMask=IncompatMask|true
detectorInconsistentAnnotations=InconsistentAnnotations|true
detectorInefficientMemberAccess=InefficientMemberAccess|true
detectorInefficientToArray=InefficientToArray|true
detectorInfiniteLoop=InfiniteLoop|true
detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|true
detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
detectorInitializationChain=InitializationChain|true
detectorInstantiateStaticClass=InstantiateStaticClass|true
detectorInvalidJUnitTest=InvalidJUnitTest|true
detectorIteratorIdioms=IteratorIdioms|true
detectorLazyInit=LazyInit|true
detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true
detectorLockedFields=LockedFields|true
detectorMethodReturnCheck=MethodReturnCheck|true
detectorMethods=Methods|true
detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true
detectorMutableLock=MutableLock|true
detectorMutableStaticFields=MutableStaticFields|true
detectorNaming=Naming|true
detectorNoise=Noise|false
detectorNoiseNullDeref=NoiseNullDeref|false
detectorNoteAnnotationRetention=NoteAnnotationRetention|true
detectorNoteCheckReturnValue=NoteCheckReturnValue|true
detectorNoteCheckReturnValueAnnotations=NoteCheckReturnValueAnnotations|true
detectorNoteDirectlyRelevantTypeQualifiers=NoteDirectlyRelevantTypeQualifiers|true
detectorNoteJCIPAnnotation=NoteJCIPAnnotation|true
detectorNoteNonNullAnnotations=NoteNonNullAnnotations|true
detectorNoteNonnullReturnValues=NoteNonnullReturnValues|true
detectorNoteSuppressedWarnings=NoteSuppressedWarnings|true
detectorNoteUnconditionalParamDerefs=NoteUnconditionalParamDerefs|true
detectorNumberConstructor=NumberConstructor|true
detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
detectorPublicSemaphores=PublicSemaphores|true
detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true
detectorRedundantInterfaces=RedundantInterfaces|true
detectorReflectiveClasses=ReflectiveClasses|true
detectorRepeatedConditionals=RepeatedConditionals|true
detectorResolveAllReferences=ResolveAllReferences|true
detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true
detectorSerializableIdiom=SerializableIdiom|true
detectorStartInConstructor=StartInConstructor|true
detectorStaticCalendarDetector=StaticCalendarDetector|true
detectorStringConcatenation=StringConcatenation|true
detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true
detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true
detectorSwitchFallthrough=SwitchFallthrough|true
detectorSynchronizationOnSharedBuiltinConstant=SynchronizationOnSharedBuiltinConstant|true
detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true
detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true
detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true
detectorTestASM=TestASM|false
detectorTestDataflowAnalysis=TestDataflowAnalysis|false
detectorTestingGround=TestingGround|false
detectorTrainFieldStoreTypes=TrainFieldStoreTypes|true
detectorTrainNonNullAnnotations=TrainNonNullAnnotations|true
detectorTrainUnconditionalDerefParams=TrainUnconditionalDerefParams|true
detectorURLProblems=URLProblems|true
detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true
detectorUnnecessaryMath=UnnecessaryMath|true
detectorUnreadFields=UnreadFields|true
detectorUseObjectEquals=UseObjectEquals|true
detectorUselessSubclassMethod=UselessSubclassMethod|true
detectorVarArgsProblems=VarArgsProblems|true
detectorVolatileUsage=VolatileUsage|true
detectorWaitInLoop=WaitInLoop|true
detectorWrongMapIterator=WrongMapIterator|true
detectorXMLFactoryBypass=XMLFactoryBypass|true
detector_threshold=3
effort=max
excludefilter0=.fbfilter.xml
filter_settings=Low|BAD_PRACTICE,CORRECTNESS,EXPERIMENTAL,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false
filter_settings_neg=NOISE|
run_at_full_build=true
netty-netty-d9c3789/.gitignore 0000664 0000000 0000000 00000000170 11650724173 0016366 0 ustar 00root root 0000000 0000000 /.project
/.classpath
/.settings
/target
/reports
/src/main/java/org/jboss/netty/util/Version.java
/*.iml
/*.ipr
/*.iws
netty-netty-d9c3789/COPYRIGHT.txt 0000664 0000000 0000000 00000001312 11650724173 0016506 0 ustar 00root root 0000000 0000000 The Netty Project - Copyright 2009 Red Hat, Inc, and is licensed under the
Apache License version 2.0 as published by the Apache Software Foundation.
A summary of the individual contributors is given below. Any omission should be
sent to Trustin Lee .
SVN Login(s) Name
-------------------------------------------------------------------------------
amit.bhayani@jboss.com Amit Bhayani
ataylor Andy Taylor
beve Daniel Bevenius
fredbregier Frederic Bregier
trustin Trustin Heuiseung Lee
-------------------------------------------------------------------------------
* JBoss is a registered trademark of Red Hat, Inc.
netty-netty-d9c3789/LICENSE.txt 0000664 0000000 0000000 00000026136 11650724173 0016233 0 ustar 00root root 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
netty-netty-d9c3789/NOTICE.txt 0000664 0000000 0000000 00000006351 11650724173 0016127 0 ustar 00root root 0000000 0000000
The Netty Project
=================
Please visit the Netty web site for more information:
* http://www.jboss.org/netty/
Copyright 2009 Red Hat, Inc.
Red Hat licenses this product to you under the Apache License, version 2.0 (the
"License"); you may not use this product except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
Also, please refer to each LICENSE..txt file, which is located in
the 'license' directory of the distribution file, for the license terms of the
components that this product depends on.
-------------------------------------------------------------------------------
This product contains the extensions to Java Collections Framework which has
been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene:
* LICENSE:
* license/LICENSE.jsr166y.txt (Public Domain)
* HOMEPAGE:
* http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
* http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/
This product contains a modified version of Robert Harder's Public Domain
Base64 Encoder and Decoder, which can be obtained at:
* LICENSE:
* license/LICENSE.base64.txt (Public Domain)
* HOMEPAGE:
* http://iharder.sourceforge.net/current/java/base64/
This product contains a modified version of 'JZlib', a re-implementation of
zlib in pure Java, which can be obtained at:
* LICENSE:
* license/LICENSE.jzlib.txt (BSD Style License)
* HOMEPAGE:
* http://www.jcraft.com/jzlib/
This product optionally depends on 'Protocol Buffers', Google's data
interchange format, which can be obtained at:
* LICENSE:
* license/LICENSE.protobuf.txt (New BSD License)
* HOMEPAGE:
* http://code.google.com/p/protobuf/
This product optionally depends on 'SLF4J', a simple logging facade for Java,
which can be obtained at:
* LICENSE:
* license/LICENSE.slf4j.txt (MIT License)
* HOMEPAGE:
* http://www.slf4j.org/
This product optionally depends on 'Apache Commons Logging', a logging
framework, which can be obtained at:
* LICENSE:
* license/LICENSE.commons-logging.txt (Apache License 2.0)
* HOMEPAGE:
* http://commons.apache.org/logging/
This product optionally depends on 'Apache Log4J', a logging framework,
which can be obtained at:
* LICENSE:
* license/LICENSE.log4j.txt (Apache License 2.0)
* HOMEPAGE:
* http://logging.apache.org/log4j/
This product optionally depends on 'JBoss Logging', a logging framework,
which can be obtained at:
* LICENSE:
* license/LICENSE.jboss-logging.txt (GNU LGPL 2.1)
* HOMEPAGE:
* http://anonsvn.jboss.org/repos/common/common-logging-spi/
This product optionally depends on 'Apache Felix', an open source OSGi
framework implementation, which can be obtained at:
* LICENSE:
* license/LICENSE.felix.txt (Apache License 2.0)
* HOMEPAGE:
* http://felix.apache.org/
netty-netty-d9c3789/license/ 0000775 0000000 0000000 00000000000 11650724173 0016022 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/license/LICENSE.base64.txt 0000664 0000000 0000000 00000003070 11650724173 0020730 0 ustar 00root root 0000000 0000000 The person or persons who have associated work with this document (the
"Dedicator" or "Certifier") hereby either (a) certifies that, to the best of
his knowledge, the work of authorship identified is in the public domain of
the country from which the work is published, or (b) hereby dedicates whatever
copyright the dedicators holds in the work of authorship identified below (the
"Work") to the public domain. A certifier, moreover, dedicates any copyright
interest he may have in the associated work, and for these purposes, is
described as a "dedicator" below.
A certifier has taken reasonable steps to verify the copyright status of this
work. Certifier recognizes that his good faith efforts may not shield him from
liability if in fact the work certified is not in the public domain.
Dedicator makes this dedication for the benefit of the public at large and to
the detriment of the Dedicator's heirs and successors. Dedicator intends this
dedication to be an overt act of relinquishment in perpetuate of all present
and future rights under copyright law, whether vested or contingent, in the
Work. Dedicator understands that such relinquishment of all rights includes
the relinquishment of all rights to enforce (by lawsuit or otherwise) those
copyrights in the Work.
Dedicator recognizes that, once placed in the public domain, the Work may be
freely reproduced, distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or non-commercial,
and in any way, including by methods that have not yet been invented or
conceived.
netty-netty-d9c3789/license/LICENSE.commons-logging.txt 0000664 0000000 0000000 00000023676 11650724173 0022761 0 ustar 00root root 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
netty-netty-d9c3789/license/LICENSE.felix.txt 0000664 0000000 0000000 00000023676 11650724173 0020771 0 ustar 00root root 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
netty-netty-d9c3789/license/LICENSE.jboss-logging.txt 0000664 0000000 0000000 00000063511 11650724173 0022416 0 ustar 00root root 0000000 0000000
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
netty-netty-d9c3789/license/LICENSE.jsr166y.txt 0000664 0000000 0000000 00000003070 11650724173 0021070 0 ustar 00root root 0000000 0000000 The person or persons who have associated work with this document (the
"Dedicator" or "Certifier") hereby either (a) certifies that, to the best of
his knowledge, the work of authorship identified is in the public domain of
the country from which the work is published, or (b) hereby dedicates whatever
copyright the dedicators holds in the work of authorship identified below (the
"Work") to the public domain. A certifier, moreover, dedicates any copyright
interest he may have in the associated work, and for these purposes, is
described as a "dedicator" below.
A certifier has taken reasonable steps to verify the copyright status of this
work. Certifier recognizes that his good faith efforts may not shield him from
liability if in fact the work certified is not in the public domain.
Dedicator makes this dedication for the benefit of the public at large and to
the detriment of the Dedicator's heirs and successors. Dedicator intends this
dedication to be an overt act of relinquishment in perpetuity of all present
and future rights under copyright law, whether vested or contingent, in the
Work. Dedicator understands that such relinquishment of all rights includes
the relinquishment of all rights to enforce (by lawsuit or otherwise) those
copyrights in the Work.
Dedicator recognizes that, once placed in the public domain, the Work may be
freely reproduced, distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or non-commercial,
and in any way, including by methods that have not yet been invented or
conceived.
netty-netty-d9c3789/license/LICENSE.jzlib.txt 0000664 0000000 0000000 00000002671 11650724173 0020764 0 ustar 00root root 0000000 0000000 Copyright (c) 2000,2001,2002,2003,2004 ymnk, JCraft,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:
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 names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
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 JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE 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.
netty-netty-d9c3789/license/LICENSE.log4j.txt 0000664 0000000 0000000 00000023676 11650724173 0020701 0 ustar 00root root 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
netty-netty-d9c3789/license/LICENSE.protobuf.txt 0000664 0000000 0000000 00000003304 11650724173 0021504 0 ustar 00root root 0000000 0000000 Copyright 2008, Google 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.
* 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.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS 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 COPYRIGHT
OWNER OR 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.
Code generated by the Protocol Buffer compiler is owned by the owner
of the input file used when generating it. This code is not
standalone and requires a support library to be linked with it. This
support library is itself covered by the above license.
netty-netty-d9c3789/license/LICENSE.slf4j.txt 0000664 0000000 0000000 00000002263 11650724173 0020671 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2004-2007 QOS.ch
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
netty-netty-d9c3789/pom.xml 0000664 0000000 0000000 00000060366 11650724173 0015730 0 ustar 00root root 0000000 0000000
4.0.0org.jbossjboss-parent5org.jboss.nettynettybundle3.2.6.FinalThe Netty Projecthttp://www.jboss.org/netty/
The Netty project is an effort to provide an asynchronous event-driven
network application framework and tools for rapid development of
maintainable high performance and high scalability protocol servers and
clients. In other words, Netty is a NIO client server framework which
enables quick and easy development of network applications such as protocol
servers and clients. It greatly simplifies and streamlines network
programming such as TCP and UDP socket server.
Apache License, Version 2.0http://www.apache.org/licenses/LICENSE-2.02008https://github.com/netty/nettyscm:git:git://github.com/netty/netty.gitscm:git:ssh://git@github.com/netty/netty.gitcom.google.protobufprotobuf-java2.3.0compiletruejavax.servletservlet-api2.5compiletrueorg.apache.felixorg.osgi.core1.4.0compiletrueorg.apache.felixorg.osgi.compendium1.4.0compiletrueorg.apache.felixjavax.servletorg.apache.felixorg.osgi.foundationorg.slf4jslf4j-api1.6.1compiletruecommons-loggingcommons-logging1.1.1compiletrueorg.jboss.loggingjboss-logging-spi2.1.2.GAcompiletruelog4jlog4j1.2.16compilemailjavax.mailjmsjavax.jmsjmxtoolscom.sun.jdmkjmxricom.sun.jmxtruejunitjunit4.8.2testorg.easymockeasymock2.5.2testorg.easymockeasymockclassextension2.5.2testorg.slf4jslf4j-simple1.6.1test1.52.2.1false${basedir}/src/main/resources${basedir}/target/licensemaven-enforcer-plugin1.0maven-compiler-plugin2.3.2UTF-81.51.5truetruetruemaven-resources-plugin2.4.3UTF-8copy-legal-infovalidatecopy-resources${basedir}/target/license/META-INF${basedir}falseCOPYRIGHT.txtLICENSE.txtNOTICE.txtlicense/*.txtmaven-surefire-plugin2.7.2never**/Abstract***/TestUtil*org.apache.felixmaven-bundle-plugin2.3.4true${project.groupId}${project.url}
${project.groupId}.container.osgi.NettyBundleActivator
!${project.groupId}.example.*,
!${project.groupId}.util.internal.*,
${project.groupId}.*;version=${project.version}
${project.groupId}.example.*,
${project.groupId}.util.internal.*,
*;resolution:=optional
registeredregistered${project.groupId}.util.Versionmaven-source-plugin2.1.2attach-sourcepackagejartruemaven-antrun-plugin1.6write-versionvalidaterunBuild number: ${buildNumber}remove-examplespackagerunorg.apache.antant1.8.2org.apache.antant-launcher1.8.2ant-contribant-contrib1.0b3antantmaven-javadoc-plugin2.7generate-javadocpackagejavadocorg.jboss.apiviz.APIvizorg.jboss.apivizapiviz1.3.1.GAfalse${basedir}/src/javadoc/stylesheet.css${basedir}/src/javadoctruetrue${project.build.directory}/api${project.build.directory}/apiapiUTF-8UTF-8truetruetruetrue${basedir}/src/javadoc/overview.html${project.name} API Reference (${project.version})${project.name} API Reference (${project.version})
-link http://java.sun.com/javase/6/docs/api/
-link http://code.google.com/apis/protocolbuffers/docs/reference/java/
-link http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/
-link http://www.osgi.org/javadoc/r4v41/
-link http://www.slf4j.org/apidocs/
-link http://commons.apache.org/logging/commons-logging-1.1.1/apidocs/
-link http://logging.apache.org/log4j/1.2/apidocs/
-group "Low-level data representation" ${project.groupId}.buffer*
-group "Central interface for all I/O operations" ${project.groupId}.channel*
-group "Client & Server bootstrapping utilities" ${project.groupId}.bootstrap*
-group "Reusable I/O event interceptors" ${project.groupId}.handler*
-group "Miscellaneous" ${project.groupId}.logging*:${project.groupId}.util*
-sourceclasspath ${project.build.outputDirectory}
-nopackagediagram
UTF-8en_US${project.groupId}.example*:${project.groupId}.container*:${project.groupId}.util.internal*maven-jxr-plugin2.2generate-xrefpackagejxrUTF-8UTF-8true${project.build.directory}/xref${project.build.directory}/api${basedir}/src/xref/stylesheet.css${project.name} Source Xref (${project.version})${project.name} Source Xref (${project.version})org.jboss.maven.pluginsmaven-jdocbook-plugin2.2.1generate-docbookpackageresourcesgenerateorg.jbossjbossorg-docbook-xslt1.1.0org.eclipse.wst.csscoreorg.eclipse.wst.ssecoreorg.jbossjbossorg-jdocbook-style1.1.0jdocbook-styleorg.eclipse.wst.csscoreorg.eclipse.wst.ssecoreorg.jbossjbossorg-fonts1.0.0jdocbook-stylemaster.xml${basedir}/src/docbook${basedir}/src/docbookcss/**/*${basedir}/src/docbookimages/**/*htmlfile:///${basedir}/src/docbook/xslt/xhtml.xslindex.htmlhtml_singlefile:///${basedir}/src/docbook/xslt/xhtml-single.xslindex.htmleclipsefile:///${basedir}/src/docbook/xslt/eclipse.xslindex.htmlpdffile:///${basedir}/src/docbook/xslt/pdf.xslnetty.pdftruesaxon1.72.0-truemaven-assembly-plugin2.2generate-distributionpackagesingle${basedir}/src/assembly/default.xml${attach-distribution}truegnumaven-release-plugin2.1false-Preleaseorg.apache.maven.pluginsmaven-eclipse-plugin2.8truetrue
netty-netty-d9c3789/src/ 0000775 0000000 0000000 00000000000 11650724173 0015167 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/argouml/ 0000775 0000000 0000000 00000000000 11650724173 0016635 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/argouml/netty.uml 0000664 0000000 0000000 00000663171 11650724173 0020535 0 ustar 00root root 0000000 0000000
The Netty Projectnetty-dev@lists.jboss.org0.28
http://www.jboss.org/netty/
Javafalsetruetruefalsefalsefalsefalsetruefalsefalse4trueLiberation Sans140Channel API Overview
UML 1.4
ArgoUML (using Netbeans XMI Writer version 1.0)0.28(6) revised on $Date: 2007-05-12 08:08:08 +0200 (Sat, 12 May 2007) $ «interface»ChannelBuffer«interface»ChannelBufferFactory
sourcePortFig="Fig1.0"
destPortFig="Fig0.0"
sourceFigNode="Fig1"
destFigNode="Fig0"
«utility»ChannelBuffers
sourcePortFig="Fig3.0"
destPortFig="Fig0.0"
sourceFigNode="Fig3"
destFigNode="Fig0"
HeapChannelBufferFactoryDirectChannelBufferFactory
sourcePortFig="Fig5.0"
destPortFig="Fig1.0"
sourceFigNode="Fig5"
destFigNode="Fig1"
sourcePortFig="Fig6.0"
destPortFig="Fig1.0"
sourceFigNode="Fig6"
destFigNode="Fig1"
ChannelBufferInputStream
sourcePortFig="Fig9.0"
destPortFig="Fig0.0"
sourceFigNode="Fig9"
destFigNode="Fig0"
ChannelBufferOutputStream
sourcePortFig="Fig11.0"
destPortFig="Fig0.0"
sourceFigNode="Fig11"
destFigNode="Fig0"
«interface»java.io.DataOutput«interface»java.io.DataInput
sourcePortFig="Fig9.0"
destPortFig="Fig14.0"
sourceFigNode="Fig9"
destFigNode="Fig14"
sourcePortFig="Fig11.0"
destPortFig="Fig13.0"
sourceFigNode="Fig11"
destFigNode="Fig13"
«utility»BootstrapClientBootstrapServerBootstrapConnectionlessBootstrap
sourcePortFig="Fig1.0"
destPortFig="Fig0"
sourceFigNode="Fig1"
destFigNode="Fig0"
sourcePortFig="Fig2.0"
destPortFig="Fig0"
sourceFigNode="Fig2"
destFigNode="Fig0"
sourcePortFig="Fig3.0"
destPortFig="Fig0"
sourceFigNode="Fig3"
destFigNode="Fig0"
«interface»ChannelFactory
sourcePortFig="Fig0.0"
destPortFig="Fig7.0"
sourceFigNode="Fig0"
destFigNode="Fig7"
«interface»ChannelFactory«interface»Channel«interface»ChannelEvent«interface»ChannelHandler«interface»ChannelPipeline
sourcePortFig="Fig1.0"
destPortFig="Fig4.0"
sourceFigNode="Fig1"
destFigNode="Fig4"
«interface»ChannelPipelineFactory
sourcePortFig="Fig6.0"
destPortFig="Fig4.0"
sourceFigNode="Fig6"
destFigNode="Fig4"
«interface»ChannelHandlerContext
sourcePortFig="Fig0.0"
destPortFig="Fig1.0"
sourceFigNode="Fig0"
destFigNode="Fig1"
sourcePortFig="Fig3.0"
destPortFig="Fig2"
sourceFigNode="Fig3"
destFigNode="Fig2"
sourcePortFig="Fig11"
destPortFig="Fig4"
sourceFigNode="Fig11"
destFigNode="Fig4"
sourcePortFig="Fig11"
destPortFig="Fig3"
sourceFigNode="Fig11"
destFigNode="Fig3"
sourcePortFig="Fig11"
destPortFig="Fig8"
sourceFigNode="Fig11"
destFigNode="Fig8"
«interface»ChannelEvent«interface»ChannelStateEvent
sourcePortFig="Fig1"
destPortFig="Fig0"
sourceFigNode="Fig1"
destFigNode="Fig0"
«interface»ExceptionEvent
sourcePortFig="Fig3"
destPortFig="Fig0"
sourceFigNode="Fig3"
destFigNode="Fig0"
«interface»MessageEvent
sourcePortFig="Fig5"
destPortFig="Fig0"
sourceFigNode="Fig5"
destFigNode="Fig0"
«interface»WriteCompletionEvent
sourcePortFig="Fig7"
destPortFig="Fig0"
sourceFigNode="Fig7"
destFigNode="Fig0"
«interface»ChildChannelStateEvent
sourcePortFig="Fig9.0"
destPortFig="Fig0"
sourceFigNode="Fig9"
destFigNode="Fig0"
«interface»ChannelHandler«interface»ChannelUpstreamHandler«interface»ChannelDownstreamHandler«interface»LifeCycleAwareChannelHandlerSimpleChannelHandlerSimpleUpstreamChannelHandlerSimpleDownstreamChannelHandler
sourcePortFig="Fig3.0"
destPortFig="Fig0"
sourceFigNode="Fig3"
destFigNode="Fig0"
sourcePortFig="Fig1.0"
destPortFig="Fig0"
sourceFigNode="Fig1"
destFigNode="Fig0"
sourcePortFig="Fig2.0"
destPortFig="Fig0"
sourceFigNode="Fig2"
destFigNode="Fig0"
sourcePortFig="Fig5.0"
destPortFig="Fig1.0"
sourceFigNode="Fig5"
destFigNode="Fig1"
sourcePortFig="Fig4.0"
destPortFig="Fig1.0"
sourceFigNode="Fig4"
destFigNode="Fig1"
sourcePortFig="Fig4.0"
destPortFig="Fig2.0"
sourceFigNode="Fig4"
destFigNode="Fig2"
sourcePortFig="Fig6.0"
destPortFig="Fig2.0"
sourceFigNode="Fig6"
destFigNode="Fig2"
netty-netty-d9c3789/src/assembly/ 0000775 0000000 0000000 00000000000 11650724173 0017006 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/assembly/default.xml 0000664 0000000 0000000 00000004516 11650724173 0021162 0 ustar 00root root 0000000 0000000
disttar.bz2zipfalse**/README***/LICENSE***/NOTICE***/COPYRIGHT***/*.txt**/*.xml**/license/****/src/****/target/****/.*/**targetjar${project.build.finalName}*.jar${project.build.finalName}*-javadoc.jartarget/apidoc/api**/**target/xrefdoc/xref**/**target/docbook/publish/en-USdoc/guide**/**
netty-netty-d9c3789/src/docbook/ 0000775 0000000 0000000 00000000000 11650724173 0016607 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/docbook/css/ 0000775 0000000 0000000 00000000000 11650724173 0017377 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/docbook/css/jbossorg.css 0000664 0000000 0000000 00000005066 11650724173 0021750 0 ustar 00root root 0000000 0000000 /*
* Copyright 2009 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
@import url("documentation.css");
@import url("docnav.css");
@import url("reports.css");
@import url("extensions.css");
@import url("codehighlight.css");
body {
background-image:url(../images/community/bkg_gradient.gif);
background-repeat:repeat-x;
margin:0 auto;
font-family:'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
font-size:12px;
max-width:55em;
padding:0em 2em;
color:#333;
line-height:150%;
text-align:justify;
}
/* Links */
a:link {color:#0066cc;}
a:visited {color:#6699cc;}
div.longdesc-link {
float:right;
color:#999;
}
/* Headings */
h1, h2, h3, h4, h5, h6 {
color:#4a5d75;
line-height:130%;
margin-top:0em;
font-family:'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
background-color:transparent;
}
h1 {
background-image:url(../images/community/title_hdr.png);
background-repeat:no-repeat;
border-top:1px dotted #CCCCCC;
line-height:1.2em;
color:#182737;
font-size:2em;
padding:1.5em;
}
h2 {font-size:1.6em;}
h3 {
font-size:1.3em;
padding-top:0em;
padding-bottom:0em;
}
h4 {
font-size:1.1em;
padding-top:0em;
padding-bottom:0em;
}
h5.formalpara {
font-size:1em;
margin-top:2em;
margin-bottom:.8em;
}
/* Element rules */
hr {
border-collapse:collapse;
border-style:none;
border-top:1px dotted #ccc;
width:100% !important;
}
sup {color:#999;}
/* Custom overrides */
tt, tt *, pre, pre *, code, code * {
font-size: 100% !important;
font-family: "Liberation Mono", "DejaVu Sans Mono", Consolas, Monaco, "Vera Sans Mono", "Lucida Console", "Courier New", monospace !important;
}
pre a:link * {color:#0066cc !important;}
pre a:visited * {color:#6699cc !important;}
.programlisting, .programlistingco pre {
line-height: 160%;
}
.programlisting img {
margin: 0;
padding: 0;
vertical-align: middle;
}
span.co {
position: relative;
left: 0;
top: 0;
margin: 0 0;
padding: 0 0;
height: 17px;
float: right;
}
span.co * {
margin: 0 0;
padding: 0 0;
}
netty-netty-d9c3789/src/docbook/en-US/ 0000775 0000000 0000000 00000000000 11650724173 0017536 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/docbook/en-US/custom.dtd 0000664 0000000 0000000 00000014263 11650724173 0021553 0 ustar 00root root 0000000 0000000
Bootstrap">
ClientBootstrap">
ServerBootstrap">
ChannelBuffer">
ChannelBuffers">
Channel">
ChannelDownstreamHandler">
ChannelEvent">
ChannelFactory">
ChannelFuture">
ChannelFutureListener">
ChannelHandler">
ChannelHandlerContext">
ChannelPipeline">
ChannelPipelineCoverage">
ChannelPipelineFactory">
Channels">
ChannelStateEvent">
ChannelUpstreamHandler">
ExceptionEvent">
MessageEvent">
SimpleChannelHandler">
ChannelGroup">
ChannelGroupFuture">
DefaultChannelGroup">
ServerSocketChannel">
SocketChannel">
NioClientSocketChannelFactory">
NioServerSocketChannelFactory">
FrameDecoder">
ProtobufEncoder">
ProtobufDecoder">
ReplayingDecoder">
VoidEnum">
SslHandler">
netty-netty-d9c3789/src/docbook/en-US/master.xml 0000664 0000000 0000000 00000004330 11650724173 0021553 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
The Netty Project 3.2 User GuideThe Proven Approach to Rapid Network Application Development
netty-netty-d9c3789/src/docbook/en-US/module/ 0000775 0000000 0000000 00000000000 11650724173 0021023 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/docbook/en-US/module/appendix.xml 0000664 0000000 0000000 00000001660 11650724173 0023360 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
Additional ResourcesTo be written...
netty-netty-d9c3789/src/docbook/en-US/module/architecture.xml 0000664 0000000 0000000 00000035621 11650724173 0024236 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
Architectural OverviewThe Architecture Diagram of Netty
In this chapter, we will examine what core functionalities are provided in
Netty and how they constitute a complete network application development
stack on top of the core. Please keep this diagram in mind as you read this
chapter.
Rich Buffer Data Structure
Netty uses its own buffer API instead of NIO ByteBuffer
to represent a sequence of bytes. This approach has significant advantages
over using ByteBuffer. Netty's new buffer type,
&ChannelBuffer; has been designed from the ground up to address the problems
of ByteBuffer and to meet the daily needs of
network application developers. To list a few cool features:
You can define your own buffer type if necessary.
Transparent zero copy is achieved by a built-in composite buffer type.
A dynamic buffer type is provided out-of-the-box, whose capacity is
expanded on demand, just like StringBuffer.
There's no need to call flip() anymore.
It is often faster than ByteBuffer.
For more information, please refer to the
org.jboss.netty.buffer package description.
Universal Asynchronous I/O API
Traditional I/O APIs in Java provide different types and methods for
different transport types. For example,
java.net.Socket and
java.net.DatagramSocket do not have any common
super type and therefore they have very different ways to perform socket
I/O.
This mismatch makes porting a network application from one transport to
another tedious and difficult. The lack of portability between
transports becomes a problem when you need to support additional
transports, as this often entails rewriting the network layer of the
application. Logically, many protocols can run on more than one
transport such as TCP/IP, UDP/IP, SCTP, and serial port communication.
To make matters worse, Java's New I/O (NIO) API introduced
incompatibilities with the old blocking I/O (OIO) API and will continue
to do so in the next release, NIO.2 (AIO). Because all these APIs are
different from each other in design and performance characteristics, you
are often forced to determine which API your application will depend on
before you even begin the implementation phase.
For instance, you might want to start with OIO because the number of
clients you are going to serve will be very small and writing a socket
server using OIO is much easier than using NIO. However, you are going
to be in trouble when your business grows exponentially and your server
needs to serve tens of thousands of clients simultaneously. You could
start with NIO, but doing so may hinder rapid development by greatly
increasing development time due to the complexity of the NIO Selector
API.
Netty has a universal asynchronous I/O interface called a &Channel;, which
abstracts away all operations required for point-to-point communication.
That is, once you wrote your application on one Netty transport, your
application can run on other Netty transports. Netty provides a number
of essential transports via one universal API:
NIO-based TCP/IP transport
(See org.jboss.netty.channel.socket.nio),
OIO-based TCP/IP transport
(See org.jboss.netty.channel.socket.oio),
OIO-based UDP/IP transport, and
Local transport (See org.jboss.netty.channel.local).
Switching from one transport to another usually takes just a couple
lines of changes such as choosing a different &ChannelFactory;
implementation.
Also, you are even able to take advantage of new transports which aren't
yet written (such as serial port communication transport), again
by replacing just a couple lines of constructor calls. Moreover, you can
write your own transport by extending the core API.
Event Model based on the Interceptor Chain Pattern
A well-defined and extensible event model is a must for an event-driven
application. Netty has a well-defined event model focused on I/O. It
also allows you to implement your own event type without breaking the
existing code because each event type is distinguished from another by
a strict type hierarchy. This is another differentiator against other
frameworks. Many NIO frameworks have no or a very limited notion of an
event model. If they offer extension at all, they often break the
existing code when you try to add custom event types
A &ChannelEvent; is handled by a list of &ChannelHandler;s in a
&ChannelPipeline;. The pipeline implements an advanced form of the
Intercepting Filter
pattern to give a user full control over how an event is handled and how
the handlers in the pipeline interact with each other. For example,
you can define what to do when data is read from a socket:
public class MyReadHandler implements &SimpleChannelHandler; {
public void messageReceived(&ChannelHandlerContext; ctx, &MessageEvent; evt) {
Object message = evt.getMessage();
// Do something with the received message.
...
// And forward the event to the next handler.
ctx.sendUpstream(evt);
}
}
You can also define what to do when a handler receives a write request:
public class MyWriteHandler implements &SimpleChannelHandler; {
public void writeRequested(&ChannelHandlerContext; ctx, &MessageEvent; evt) {
Object message = evt.getMessage();
// Do something with the message to be written.
...
// And forward the event to the next handler.
ctx.sendDownstream(evt);
}
}
For more information on the event model, please refer to the
API documentation of &ChannelEvent; and &ChannelPipeline;.
Advanced Components for More Rapid Development
On top of the core components mentioned above, that already enable the
implementation of all types of network applications, Netty provides a set
of advanced features to accelerate the page of development even more.
Codec framework
As demonstrated in , it is always a good
idea to separate a protocol codec from business logic. However, there
are some complications when implementing this idea from scratch. You
have to deal with the fragmentation of messages. Some protocols are
multi-layered (i.e. built on top of other lower level protocols). Some
are too complicated to be implemented in a single state machine.
Consequently, a good network application framework should provide an
extensible, reusable, unit-testable, and multi-layered codec framework
that generates maintainable user codecs.
Netty provides a number of basic and advanced codecs to address most
issues you will encounter when you write a protocol codec regardless
if it is simple or not, binary or text - simply whatever.
SSL / TLS Support
Unlike old blocking I/O, it is a non-trivial task to support SSL in NIO.
You can't simply wrap a stream to encrypt or decrypt data but you have
to use javax.net.ssl.SSLEngine.
SSLEngine is a state machine which is as complex
as SSL itself. You have to manage all possible states such as cipher
suite and encryption key negotiation (or re-negotiation), certificate
exchange, and validation. Moreover, SSLEngine is
not even completely thread-safe, as one would expect.
In Netty, &SslHandler; takes care of all the gory details and pitfalls
of SSLEngine. All you need to do is to configure
the &SslHandler; and insert it into your &ChannelPipeline;. It also
allows you to implement advanced features like
StartTLS
very easily.
HTTP Implementation
HTTP is definitely the most popular protocol in the Internet. There are
already a number of HTTP implementations such as a Servlet container.
Then why does Netty have HTTP on top of its core?
Netty's HTTP support is very different from the existing HTTP libraries.
It gives you complete control over how HTTP messages are exchanged at a
low level. Because it is basically the combination of an HTTP codec and
HTTP message classes, there is no restriction such as an enforced thread
model. That is, you can write your own HTTP client or server that works
exactly the way you want. You have full control over everything that's
in the HTTP specification, including the thread model, connection life
cycle, and chunked encoding.
Thanks to its highly customizable nature, you can write a very efficient
HTTP server such as:
Chat server that requires persistent connections and server push
technology (e.g. Comet
and WebSockets)
Media streaming server that needs to keep the connection open
until the whole media is streamed (e.g. 2 hours of video)
File server that allows the uploading of large files without
memory pressure (e.g. uploading 1GB per request)
Scalable mash-up client that connects to tens of thousands of 3rd
party web services asynchronously
Google Protocol Buffer IntegrationGoogle Protocol Buffers
are an ideal solution for the rapid implementation of a highly efficient
binary protocols that evolve over time. With &ProtobufEncoder; and
&ProtobufDecoder;, you can turn the message classes generated by the
Google Protocol Buffers Compiler (protoc) into Netty codec. Please take
a look into the
'LocalTime' example
that shows how easily you can create a high-performing binary protocol
client and server from the
sample protocol definition.
Summary
In this chapter, we reviewed the overall architecture of Netty from the
feature standpoint. Netty has a simple, yet powerful architecture.
It is composed of three components - buffer, channel, and event model -
and all advanced features are built on top of the three core components.
Once you understood how these three work together, it should not be
difficult to understand the more advanced features which were covered
briefly in this chapter.
You might still have unanswered questions about what the overall
architecture looks like exactly and how each of the features work
together. If so, it is a good idea to
talk to us to improve this guide.
netty-netty-d9c3789/src/docbook/en-US/module/codec.xml 0000664 0000000 0000000 00000001653 11650724173 0022627 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
Encoders and DecodersTo be written...
netty-netty-d9c3789/src/docbook/en-US/module/preface.xml 0000664 0000000 0000000 00000007767 11650724173 0023173 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
PrefaceThe Problem
Nowadays we use general purpose applications or libraries to communicate
with each other. For example, we often use an HTTP client library to
retrieve information from a web server and to invoke a remote procedure
call via web services.
However, a general purpose protocol or its implementation sometimes
does not scale very well. It is like we don't use a general purpose
HTTP server to exchange huge files, e-mail messages, and near-realtime
messages such as financial information and multiplayer game data.
What's required is a highly optimized protocol implementation which is
dedicated to a special purpose. For example, you might want to
implement an HTTP server which is optimized for AJAX-based chat
application, media streaming, or large file transfer. You could even
want to design and implement a whole new protocol which is precisely
tailored to your need.
Another inevitable case is when you have to deal with a legacy
proprietary protocol to ensure the interoperability with an old system.
What matters in this case is how quickly we can implement that protocol
while not sacrificing the stability and performance of the resulting
application.
The SolutionThe Netty project is
an effort to provide an asynchronous event-driven network application
framework and tooling for the rapid development of maintainable
high-performance · high-scalability protocol servers and clients.
In other words, Netty is a NIO client server framework which enables
quick and easy development of network applications such as protocol
servers and clients. It greatly simplifies and streamlines network
programming such as TCP and UDP socket server development.
'Quick and easy' does not mean that a resulting application will suffer
from a maintainability or a performance issue. Netty has been designed
carefully with the experiences earned from the implementation of a lot
of protocols such as FTP, SMTP, HTTP, and various binary and text-based
legacy protocols. As a result, Netty has succeeded to find a way to
achieve ease of development, performance, stability, and flexibility
without a compromise.
Some users might already have found other network application
framework that claims to have the same advantage, and you might want
to ask what makes Netty so different from them. The answer is the
philosophy where it is built on. Netty is designed to give you the most
comfortable experience both in terms of the API and the implementation
from the day one. It is not something tangible but you will realize that
this philosophy will make your life much easier as you read this guide
and play with Netty.
netty-netty-d9c3789/src/docbook/en-US/module/security.xml 0000664 0000000 0000000 00000001652 11650724173 0023420 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
Securing the WireTo be written...
netty-netty-d9c3789/src/docbook/en-US/module/start.xml 0000664 0000000 0000000 00000140373 11650724173 0022712 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
Getting Started
This chapter tours around the core constructs of Netty with simple
examples to let you get started quickly. You will be able to write a
client and a server on top of Netty right away when you are at the
end of this chapter.
If you prefer top-down approach in learning something, you might want to
start from and get back here.
Before Getting Started
The minimum requirements to run the examples which are introduced in
this chapter are only two; the latest version of Netty and JDK 1.5 or
above. The latest version of Netty is available in
the project download page. To download
the right version of JDK, please refer to your preferred JDK vendor's web
site.
As you read, you might have more questions about the classes introduced
in this chapter. Please refer to the API reference whenever you want to
know more about them. All class names in this document are linked to the
online API reference for your convenience. Also, please don't hesitate to
contact the Netty project community and
let us know if there's any incorrect information, errors in grammar and
typo, and if you have a good idea to improve the documentation.
Writing a Discard Server
The most simplistic protocol in the world is not 'Hello, World!' but
DISCARD. It's
a protocol which discards any received data without any response.
To implement the DISCARD protocol, the only thing you need to do is
to ignore all received data. Let us start straight from the handler
implementation, which handles I/O events generated by Netty.
package org.jboss.netty.example.discard;
public class DiscardServerHandler extends &SimpleChannelHandler; {
@Override
public void messageReceived(&ChannelHandlerContext; ctx, &MessageEvent; e) {
}
@Override
public void exceptionCaught(&ChannelHandlerContext; ctx, &ExceptionEvent; e) {
e.getCause().printStackTrace();
&Channel; ch = e.getChannel();
ch.close();
}
}DiscardServerHandler extends
&SimpleChannelHandler;, which is an implementation of
&ChannelHandler;. &SimpleChannelHandler; provides various event
handler methods that you can override. For now, it is just enough
to extend &SimpleChannelHandler; rather than to implement
the handler interfaces by yourself.
We override the messageReceived event
handler method here. This method is called with a &MessageEvent;,
which contains the received data, whenever new data is received
from a client. In this example, we ignore the received data by doing
nothing to implement the DISCARD protocol.
exceptionCaught event handler method is
called with an &ExceptionEvent; when an exception was raised by
Netty due to I/O error or by a handler implementation due to the
exception thrown while processing events. In most cases, the
caught exception should be logged and its associated channel
should be closed here, although the implementation of this method
can be different depending on what you want to do to deal with an
exceptional situation. For example, you might want to send a
response message with an error code before closing the connection.
So far so good. We have implemented the first half of the DISCARD server.
What's left now is to write the main method
which starts the server with the DiscardServerHandler.
package org.jboss.netty.example.discard;
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
public class DiscardServer {
public static void main(String[] args) throws Exception {
&ChannelFactory; factory =
new &NioServerSocketChannelFactory;(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
&ServerBootstrap; bootstrap = new &ServerBootstrap;(factory);
bootstrap.setPipelineFactory(new &ChannelPipelineFactory;() {
public &ChannelPipeline; getPipeline() {
return &Channels;.pipeline(new DiscardServerHandler());
}
});
bootstrap.setOption("child.tcpNoDelay", true);
bootstrap.setOption("child.keepAlive", true);
bootstrap.bind(new InetSocketAddress(8080));
}
}
&ChannelFactory; is a factory which creates and manages &Channel;s
and its related resources. It processes all I/O requests and
performs I/O to generate &ChannelEvent;s. Netty provides various
&ChannelFactory; implementations. We are implementing a server-side
application in this example, and therefore
&NioServerSocketChannelFactory; was used. Another thing to note is
that it does not create I/O threads by itself. It is supposed to
acquire threads from the thread pool you specified in the
constructor, and it gives you more control over how threads should
be managed in the environment where your application runs, such as
an application server with a security manager.
&ServerBootstrap; is a helper class that sets up a server. You can
set up the server using a &Channel; directly. However, please note
that this is a tedious process and you do not need to do that in most
cases.
Here, we configure the &ChannelPipelineFactory;. Whenever a new
connection is accepted by the server, a new &ChannelPipeline; will be
created by the specified &ChannelPipelineFactory;. The new pipeline
contains the DiscardServerHandler. As the
application gets complicated, it is likely that you will add more
handlers to the pipeline and extract this anonymous class into a top
level class eventually.
You can also set the parameters which are specific to the &Channel;
implementation. We are writing a TCP/IP server, so we are allowed
to set the socket options such as tcpNoDelay and
keepAlive. Please note that the
"child." prefix was added to all options. It
means the options will be applied to the accepted &Channel;s instead
of the options of the &ServerSocketChannel;. You could do the
following to set the options of the &ServerSocketChannel;:
bootstrap.setOption("reuseAddress", true);
We are ready to go now. What's left is to bind to the port and to
start the server. Here, we bind to the port 8080
of all NICs (network interface cards) in the machine. You can now
call the bind method as many times as
you want (with different bind addresses.)
Congratulations! You've just finished your first server on top of Netty.
Looking into the Received Data
Now that we have written our first server, we need to test if it really
works. The easiest way to test it is to use the telnet
command. For example, you could enter "telnet localhost
8080" in the command line and type something.
However, can we say that the server is working fine? We cannot really
know that because it is a discard server. You will not get any response
at all. To prove it is really working, let us modify the server to print
what it has received.
We already know that &MessageEvent; is generated whenever data is
received and the messageReceived handler method
will be invoked. Let us put some code into the
messageReceived method of the
DiscardServerHandler:
@Override
public void messageReceived(&ChannelHandlerContext; ctx, &MessageEvent; e) {
&ChannelBuffer; buf = (ChannelBuffer) e.getMessage();
while(buf.readable()) {
System.out.println((char) buf.readByte());
System.out.flush();
}
}
It is safe to assume the message type in socket transports is always
&ChannelBuffer;. &ChannelBuffer; is a fundamental data structure
which stores a sequence of bytes in Netty. It's similar to NIO
ByteBuffer, but it is easier to use and more
flexible. For example, Netty allows you to create a composite
&ChannelBuffer; which combines multiple &ChannelBuffer;s reducing
the number of unnecessary memory copy.
Although it resembles to NIO ByteBuffer a lot,
it is highly recommended to refer to the API reference. Learning how
to use &ChannelBuffer; correctly is a critical step in using Netty
without difficulty.
If you run the telnet command again, you will see the
server prints what has received.
The full source code of the discard server is located in the
org.jboss.netty.example.discard package of the
distribution.
Writing an Echo Server
So far, we have been consuming data without responding at all. A server,
however, is usually supposed to respond to a request. Let us learn how to
write a response message to a client by implementing the
ECHO protocol,
where any received data is sent back.
The only difference from the discard server we have implemented in the
previous sections is that it sends the received data back instead of
printing the received data out to the console. Therefore, it is enough
again to modify the messageReceived method:
@Override
public void messageReceived(&ChannelHandlerContext; ctx, &MessageEvent; e) {
&Channel; ch = e.getChannel();
ch.write(e.getMessage());
}
A &ChannelEvent; object has a reference to its associated &Channel;.
Here, the returned &Channel; represents the connection which received
the &MessageEvent;. We can get the &Channel; and call the
write method to write something back to
the remote peer.
If you run the telnet command again, you will see the
server sends back whatever you have sent to it.
The full source code of the echo server is located in the
org.jboss.netty.example.echo package of the
distribution.
Writing a Time Server
The protocol to implement in this section is the
TIME protocol.
It is different from the previous examples in that it sends a message,
which contains a 32-bit integer, without receiving any requests and
loses the connection once the message is sent. In this example, you
will learn how to construct and send a message, and to close the
connection on completion.
Because we are going to ignore any received data but to send a message
as soon as a connection is established, we cannot use the
messageReceived method this time. Instead,
we should override the channelConnected method.
The following is the implementation:
package org.jboss.netty.example.time;
public class TimeServerHandler extends &SimpleChannelHandler; {
@Override
public void channelConnected(&ChannelHandlerContext; ctx, &ChannelStateEvent; e) {
&Channel; ch = e.getChannel();
&ChannelBuffer; time = &ChannelBuffers;.buffer(4);
time.writeInt((int) (System.currentTimeMillis() / 1000));
&ChannelFuture; f = ch.write(time);
f.addListener(new &ChannelFutureListener;() {
public void operationComplete(&ChannelFuture; future) {
&Channel; ch = future.getChannel();
ch.close();
}
});
}
@Override
public void exceptionCaught(&ChannelHandlerContext; ctx, &ExceptionEvent; e) {
e.getCause().printStackTrace();
e.getChannel().close();
}
}
As explained, channelConnected method will
be invoked when a connection is established. Let us write the 32-bit
integer that represents the current time in seconds here.
To send a new message, we need to allocate a new buffer which will
contain the message. We are going to write a 32-bit integer, and
therefore we need a &ChannelBuffer; whose capacity is
4 bytes. The &ChannelBuffers; helper class is
used to allocate a new buffer. Besides the
buffer method, &ChannelBuffers; provides a
lot of useful methods related to the &ChannelBuffer;. For more
information, please refer to the API reference.
On the other hand, it is a good idea to use static imports for
&ChannelBuffers;:
import static org.jboss.netty.buffer.&ChannelBuffers;.*;
...
&ChannelBuffer; dynamicBuf = dynamicBuffer(256);
&ChannelBuffer; ordinaryBuf = buffer(1024);
As usual, we write the constructed message.
But wait, where's the flip? Didn't we used
to call ByteBuffer.flip() before sending a
message in NIO? &ChannelBuffer; does not have such a method because
it has two pointers; one for read operations and the other for write
operations. The writer index increases when you write something to
a &ChannelBuffer; while the reader index does not change. The reader
index and the writer index represents where the message starts and
ends respectively.
In contrast, NIO buffer does not provide a clean way to figure out
where the message content starts and ends without calling the
flip method. You will be in trouble when
you forget to flip the buffer because nothing or incorrect data will
be sent. Such an error does not happen in Netty because we have
different pointer for different operation types. You will find it
makes your life much easier as you get used to it -- a life without
flipping out!
Another point to note is that the write
method returns a &ChannelFuture;. A &ChannelFuture; represents an
I/O operation which has not yet occurred. It means, any requested
operation might not have been performed yet because all operations
are asynchronous in Netty. For example, the following code might
close the connection even before a message is sent:
&Channel; ch = ...;
ch.write(message);
ch.close();
Therefore, you need to call the close
method after the &ChannelFuture;, which was returned by the
write method, notifies you when the write
operation has been done. Please note that, close
also might not close the connection immediately, and it returns a
&ChannelFuture;.
How do we get notified when the write request is finished then?
This is as simple as adding a &ChannelFutureListener; to the returned
&ChannelFuture;. Here, we created a new anonymous &ChannelFutureListener;
which closes the &Channel; when the operation is done.
Alternatively, you could simplify the code using a pre-defined
listener:
f.addListener(&ChannelFutureListener;.CLOSE);Writing a Time Client
Unlike DISCARD and ECHO servers, we need a client for the TIME protocol
because a human cannot translate a 32-bit binary data into a date on a
calendar. In this section, we discuss how to make sure the server works
correctly and learn how to write a client with Netty.
The biggest and only difference between a server and a client in Netty
is that different &Bootstrap; and &ChannelFactory; are required. Please
take a look at the following code:
package org.jboss.netty.example.time;
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
public class TimeClient {
public static void main(String[] args) throws Exception {
String host = args[0];
int port = Integer.parseInt(args[1]);
&ChannelFactory; factory =
new &NioClientSocketChannelFactory;(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
&ClientBootstrap; bootstrap = new &ClientBootstrap;(factory);
bootstrap.setPipelineFactory(new &ChannelPipelineFactory;() {
public &ChannelPipeline; getPipeline() {
return &Channels;.pipeline(new TimeClientHandler());
}
});
bootstrap.setOption("tcpNoDelay", true);
bootstrap.setOption("keepAlive", true);
bootstrap.connect(new InetSocketAddress(host, port));
}
}
&NioClientSocketChannelFactory;, instead of &NioServerSocketChannelFactory;
was used to create a client-side &Channel;.
&ClientBootstrap; is a client-side counterpart of &ServerBootstrap;.
Please note that there's no "child." prefix.
A client-side &SocketChannel; does not have a parent.
We should call the connect method instead of
the bind method.
As you can see, it is not really different from the server side startup.
What about the &ChannelHandler; implementation? It should receive a
32-bit integer from the server, translate it into a human readable format,
print the translated time, and close the connection:
package org.jboss.netty.example.time;
import java.util.Date;
public class TimeClientHandler extends &SimpleChannelHandler; {
@Override
public void messageReceived(&ChannelHandlerContext; ctx, &MessageEvent; e) {
&ChannelBuffer; buf = (&ChannelBuffer;) e.getMessage();
long currentTimeMillis = buf.readInt() * 1000L;
System.out.println(new Date(currentTimeMillis));
e.getChannel().close();
}
@Override
public void exceptionCaught(&ChannelHandlerContext; ctx, &ExceptionEvent; e) {
e.getCause().printStackTrace();
e.getChannel().close();
}
}
It looks very simple and does not look any different from the server side
example. However, this handler sometimes will refuse to work raising an
IndexOutOfBoundsException. We discuss why
this happens in the next section.
Dealing with a Stream-based Transport
One Small Caveat of Socket Buffer
In a stream-based transport such as TCP/IP, received data is stored
into a socket receive buffer. Unfortunately, the buffer of a
stream-based transport is not a queue of packets but a queue of bytes.
It means, even if you sent two messages as two independent packets, an
operating system will not treat them as two messages but as just a
bunch of bytes. Therefore, there is no guarantee that what you read
is exactly what your remote peer wrote. For example, let us assume
that the TCP/IP stack of an operating system has received three packets:
+-----+-----+-----+
| ABC | DEF | GHI |
+-----+-----+-----+
Because of this general property of a stream-based protocol, there's
high chance of reading them in the following fragmented form in your
application:
+----+-------+---+---+
| AB | CDEFG | H | I |
+----+-------+---+---+
Therefore, a receiving part, regardless it is server-side or
client-side, should defrag the received data into one or more meaningful
frames that could be easily understood by the
application logic. In case of the example above, the received data
should be framed like the following:
+-----+-----+-----+
| ABC | DEF | GHI |
+-----+-----+-----+
The First Solution
Now let us get back to the TIME client example. We have the same
problem here. A 32-bit integer is a very small amount of data, and it
is not likely to be fragmented often. However, the problem is that it
can be fragmented, and the possibility of
fragmentation will increase as the traffic increases.
The simplistic solution is to create an internal cumulative buffer and
wait until all 4 bytes are received into the internal buffer. The
following is the modified TimeClientHandler
implementation that fixes the problem:
package org.jboss.netty.example.time;
import static org.jboss.netty.buffer.&ChannelBuffers;.*;
import java.util.Date;
public class TimeClientHandler extends &SimpleChannelHandler; {
private final &ChannelBuffer; buf = dynamicBuffer();
@Override
public void messageReceived(&ChannelHandlerContext; ctx, &MessageEvent; e) {
&ChannelBuffer; m = (&ChannelBuffer;) e.getMessage();
buf.writeBytes(m);
if (buf.readableBytes() >= 4) {
long currentTimeMillis = buf.readInt() * 1000L;
System.out.println(new Date(currentTimeMillis));
e.getChannel().close();
}
}
@Override
public void exceptionCaught(&ChannelHandlerContext; ctx, &ExceptionEvent; e) {
e.getCause().printStackTrace();
e.getChannel().close();
}
}
A dynamic buffer is a &ChannelBuffer; which
increases its capacity on demand. It's very useful when you don't
know the length of the message.
First, all received data should be cumulated into
buf.
And then, the handler must check if buf has enough
data, 4 bytes in this example, and proceed to the actual business
logic. Otherwise, Netty will call the
messageReceived method again when more
data arrives, and eventually all 4 bytes will be cumulated.
The Second Solution
Although the first solution has resolved the problem with the TIME
client, the modified handler does not look that clean. Imagine a more
complicated protocol which is composed of multiple fields such as a
variable length field. Your &ChannelHandler; implementation will
become unmaintainable very quickly.
As you may have noticed, you can add more than one &ChannelHandler; to
a &ChannelPipeline;, and therefore, you can split one monolithic
&ChannelHandler; into multiple modular ones to reduce the complexity of
your application. For example, you could split
TimeClientHandler into two handlers:
TimeDecoder which deals with the
fragmentation issue, and
the initial simple version of TimeClientHandler.
Fortunately, Netty provides an extensible class which helps you write
the first one out of the box:
package org.jboss.netty.example.time;
public class TimeDecoder extends &FrameDecoder; {
@Override
protected Object decode(
&ChannelHandlerContext; ctx, &Channel; channel, &ChannelBuffer; buffer) {
if (buffer.readableBytes() < 4) {
return null;
}
return buffer.readBytes(4);
}
}
&FrameDecoder; is an implementation of &ChannelHandler; which
makes it easy to which deals with the fragmentation issue.
&FrameDecoder; calls decode method with
an internally maintained cumulative buffer whenever new data is
received.
If null is returned, it means there's not
enough data yet. &FrameDecoder; will call again when there is a
sufficient amount of data.
If non-null is returned, it means the
decode method has decoded a message
successfully. &FrameDecoder; will discard the read part of its
internal cumulative buffer. Please remember that you don't need
to decode multiple messages. &FrameDecoder; will keep calling
the decoder method until it returns
null.
Now that we have another handler to insert into the &ChannelPipeline;,
we should modify the &ChannelPipelineFactory; implementation in the
TimeClient:
bootstrap.setPipelineFactory(new &ChannelPipelineFactory;() {
public &ChannelPipeline; getPipeline() {
return &Channels;.pipeline(
new TimeDecoder(),
new TimeClientHandler());
}
});
If you are an adventurous person, you might want to try the
&ReplayingDecoder; which simplifies the decoder even more. You will
need to consult the API reference for more information though.
package org.jboss.netty.example.time;
public class TimeDecoder extends &ReplayingDecoder;<&VoidEnum;> {
@Override
protected Object decode(
&ChannelHandlerContext; ctx, &Channel; channel,
&ChannelBuffer; buffer, &VoidEnum; state) {
return buffer.readBytes(4);
}
}
Additionally, Netty provides out-of-the-box decoders which enables
you to implement most protocols very easily and helps you avoid from
ending up with a monolithic unmaintainable handler implementation.
Please refer to the following packages for more detailed examples:
org.jboss.netty.example.factorial for
a binary protocol, and
org.jboss.netty.example.telnet for
a text line-based protocol.
Speaking in POJO instead of ChannelBuffer
All the examples we have reviewed so far used a &ChannelBuffer; as a
primary data structure of a protocol message. In this section, we will
improve the TIME protocol client and server example to use a
POJO instead of a
&ChannelBuffer;.
The advantage of using a POJO in your &ChannelHandler; is obvious;
your handler becomes more maintainable and reusable by separating the
code which extracts information from &ChannelBuffer; out from the
handler. In the TIME client and server examples, we read only one
32-bit integer and it is not a major issue to use &ChannelBuffer; directly.
However, you will find it is necessary to make the separation as you
implement a real world protocol.
First, let us define a new type called UnixTime.
package org.jboss.netty.example.time;
import java.util.Date;
public class UnixTime {
private final int value;
public UnixTime(int value) {
this.value = value;
}
public int getValue() {
return value;
}
@Override
public String toString() {
return new Date(value * 1000L).toString();
}
}
We can now revise the TimeDecoder to return
a UnixTime instead of a &ChannelBuffer;.
@Override
protected Object decode(
&ChannelHandlerContext; ctx, &Channel; channel, &ChannelBuffer; buffer) {
if (buffer.readableBytes() < 4) {
return null;
}
return new UnixTime(buffer.readInt());
}
&FrameDecoder; and &ReplayingDecoder; allow you to return an object
of any type. If they were restricted to return only a
&ChannelBuffer;, we would have to insert another &ChannelHandler;
which transforms a &ChannelBuffer; into a
UnixTime.
With the updated decoder, the TimeClientHandler
does not use &ChannelBuffer; anymore:
@Override
public void messageReceived(&ChannelHandlerContext; ctx, &MessageEvent; e) {
UnixTime m = (UnixTime) e.getMessage();
System.out.println(m);
e.getChannel().close();
}
Much simpler and elegant, right? The same technique can be applied on
the server side. Let us update the
TimeServerHandler first this time:
@Override
public void channelConnected(&ChannelHandlerContext; ctx, &ChannelStateEvent; e) {
UnixTime time = new UnixTime(System.currentTimeMillis() / 1000);
&ChannelFuture; f = e.getChannel().write(time);
f.addListener(&ChannelFutureListener;.CLOSE);
}
Now, the only missing piece is an encoder, which is an implementation of
&ChannelHandler; that translates a UnixTime back
into a &ChannelBuffer;. It's much simpler than writing a decoder because
there's no need to deal with packet fragmentation and assembly when
encoding a message.
package org.jboss.netty.example.time;
import static org.jboss.netty.buffer.&ChannelBuffers;.*;
public class TimeEncoder extends &SimpleChannelHandler; {
public void writeRequested(&ChannelHandlerContext; ctx, &MessageEvent; e) {
UnixTime time = (UnixTime) e.getMessage();
&ChannelBuffer; buf = buffer(4);
buf.writeInt(time.getValue());
&Channels;.write(ctx, e.getFuture(), buf);
}
}
An encoder overrides the writeRequested
method to intercept a write request. Please note that the
&MessageEvent; parameter here is the same type which was specified
in messageReceived but they are interpreted
differently. A &ChannelEvent; can be either an
upstream or downstream
event depending on the direction where the event flows.
For instance, a &MessageEvent; can be an upstream event when called
for messageReceived or a downstream event
when called for writeRequested.
Please refer to the API reference to learn more about the difference
between a upstream event and a downstream event.
Once done with transforming a POJO into a &ChannelBuffer;, you should
forward the new buffer to the previous &ChannelDownstreamHandler; in
the &ChannelPipeline;. &Channels; provides various helper methods
which generates and sends a &ChannelEvent;. In this example,
&Channels;.write(...) method creates a new
&MessageEvent; and sends it to the previous &ChannelDownstreamHandler;
in the &ChannelPipeline;.
On the other hand, it is a good idea to use static imports for
&Channels;:
import static org.jboss.netty.channel.&Channels;.*;
...
&ChannelPipeline; pipeline = pipeline();
write(ctx, e.getFuture(), buf);
fireChannelDisconnected(ctx);
The last task left is to insert a TimeEncoder
into the &ChannelPipeline; on the server side, and it is left as a
trivial exercise.
Shutting Down Your Application
If you ran the TimeClient, you must have noticed
that the application doesn't exit but just keep running doing nothing.
Looking from the full stack trace, you will also find a couple I/O threads
are running. To shut down the I/O threads and let the application exit
gracefully, you need to release the resources allocated by &ChannelFactory;.
The shutdown process of a typical network application is composed of the
following three steps:
Close all server sockets if there are any,
Close all non-server sockets (i.e. client sockets and accepted
sockets) if there are any, and
Release all resources used by &ChannelFactory;.
To apply the three steps above to the TimeClient,
TimeClient.main() could shut itself down
gracefully by closing the only one client connection and releasing all
resources used by &ChannelFactory;:
package org.jboss.netty.example.time;
public class TimeClient {
public static void main(String[] args) throws Exception {
...
&ChannelFactory; factory = ...;
&ClientBootstrap; bootstrap = ...;
...
&ChannelFuture; future = bootstrap.connect(...);
future.awaitUninterruptibly();
if (!future.isSuccess()) {
future.getCause().printStackTrace();
}
future.getChannel().getCloseFuture().awaitUninterruptibly();
factory.releaseExternalResources();
}
}
The connect method of &ClientBootstrap;
returns a &ChannelFuture; which notifies when a connection attempt
succeeds or fails. It also has a reference to the &Channel; which
is associated with the connection attempt.
Wait for the returned &ChannelFuture; to determine if the connection
attempt was successful or not.
If failed, we print the cause of the failure to know why it failed.
the getCause() method of &ChannelFuture; will
return the cause of the failure if the connection attempt was neither
successful nor cancelled.
Now that the connection attempt is over, we need to wait until the
connection is closed by waiting for the closeFuture
of the &Channel;. Every &Channel; has its own closeFuture
so that you are notified and can perform a certain action on closure.
Even if the connection attempt has failed the closeFuture
will be notified because the &Channel; will be closed automatically
when the connection attempt fails.
All connections have been closed at this point. The only task left
is to release the resources being used by &ChannelFactory;. It is as
simple as calling its releaseExternalResources()
method. All resources including the NIO Selectors
and thread pools will be shut down and terminated automatically.
Shutting down a client was pretty easy, but how about shutting down a
server? You need to unbind from the port and close all open accepted
connections. To do this, you need a data structure that keeps track of
the list of active connections, and it's not a trivial task. Fortunately,
there is a solution, &ChannelGroup;.
&ChannelGroup; is a special extension of Java collections API which
represents a set of open &Channel;s. If a &Channel; is added to a
&ChannelGroup; and the added &Channel; is closed, the closed &Channel;
is removed from its &ChannelGroup; automatically. You can also perform
an operation on all &Channel;s in the same group. For instance, you can
close all &Channel;s in a &ChannelGroup; when you shut down your server.
To keep track of open sockets, you need to modify the
TimeServerHandler to add a new open &Channel; to
the global &ChannelGroup;, TimeServer.allChannels:
@Override
public void channelOpen(&ChannelHandlerContext; ctx, &ChannelStateEvent; e) {
TimeServer.allChannels.add(e.getChannel());
}
Yes, &ChannelGroup; is thread-safe.
Now that the list of all active &Channel;s are maintained automatically,
shutting down a server is as easy as shutting down a client:
package org.jboss.netty.example.time;
public class TimeServer {
static final &ChannelGroup; allChannels = new &DefaultChannelGroup;("time-server");
public static void main(String[] args) throws Exception {
...
&ChannelFactory; factory = ...;
&ServerBootstrap; bootstrap = ...;
...
&Channel; channel = bootstrap.bind(...);
allChannels.add(channel);
waitForShutdownCommand();
&ChannelGroupFuture; future = allChannels.close();
future.awaitUninterruptibly();
factory.releaseExternalResources();
}
}
&DefaultChannelGroup; requires the name of the group as a constructor
parameter. The group name is solely used to distinguish one group
from others.
The bind method of &ServerBootstrap;
returns a server side &Channel; which is bound to the specified
local address. Calling the close() method
of the returned &Channel; will make the &Channel; unbind from the
bound local address.
Any type of &Channel;s can be added to a &ChannelGroup; regardless if
it is either server side, client-side, or accepted. Therefore,
you can close the bound &Channel; along with the accepted &Channel;s
in one shot when the server shuts down.
waitForShutdownCommand() is an imaginary
method that waits for the shutdown signal. You could wait for a
message from a privileged client or the JVM shutdown hook.
You can perform the same operation on all channels in the same
&ChannelGroup;. In this case, we close all channels, which means
the bound server-side &Channel; will be unbound and all accepted
connections will be closed asynchronously. To notify when all
connections were closed successfully, it returns a &ChannelGroupFuture;
which has a similar role with &ChannelFuture;.
Summary
In this chapter, we had a quick tour of Netty with a demonstration on how
to write a fully working network application on top of Netty. More
questions you may have will be covered in the upcoming chapters and the
revised version of this chapter. Please also note that the
community is always waiting for your
questions and ideas to help you and keep improving Netty based on your
feed back.
netty-netty-d9c3789/src/docbook/en-US/module/state-mgmt.xml 0000664 0000000 0000000 00000001653 11650724173 0023634 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
State ManagementTo be written...
netty-netty-d9c3789/src/docbook/en-US/module/template.xml 0000664 0000000 0000000 00000001650 11650724173 0023362 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
Chapter titleTo be written...
netty-netty-d9c3789/src/docbook/en-US/module/threading.xml 0000664 0000000 0000000 00000001653 11650724173 0023517 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
Thread ManagementTo be written...
netty-netty-d9c3789/src/docbook/en-US/module/transport.xml 0000664 0000000 0000000 00000001644 11650724173 0023606 0 ustar 00root root 0000000 0000000
%CustomDTD;
]>
TransportsTo be written...
netty-netty-d9c3789/src/docbook/images/ 0000775 0000000 0000000 00000000000 11650724173 0020054 5 ustar 00root root 0000000 0000000 netty-netty-d9c3789/src/docbook/images/architecture.odg 0000664 0000000 0000000 00000041260 11650724173 0023234 0 ustar 00root root 0000000 0000000 PK Ú0<Ÿ.Ä+ + mimetypeapplication/vnd.oasis.opendocument.graphicsPK Ú0<