This document is included in the OpenFire group of a friend included in the class description

Source: Internet
Author: User

1. Build Path:
A) source folder: Includes OpenFire and code for each plugin.
b) libraries:build/lib under Jar package and plugin under Jar package, Jdk/lib/tools.jar (compiled JSP required).

2. Ant Build:build/build.xml
A) OpenFire (default): Build OpenFire.
b) Plugins: Build all plugins.
c) Plugin–dplugin=search: Build plugin search.

3. Start Server:org.jivesoftware.openfire.starter.ServerStarter
A) VM arguments: root, library, plug-in directory, and debug mode-dopenfirehome=target/openfire-dopenfire.lib.dir=target/openfire/lib-dplugindirs= Target/openfire/plugins-ddevelopmentmode=true
b) classpath:src/i18n: internationalized text. Src/resources/jar:mime type and console configuration file.

4. Running:
A) Serverstarter: Update ClassLoader, add Lib in, instantiate the only xmppserver.
b) xmppserver:i. Initialize: Locate openfirehome,jiveglobals read conf/openfire.xml,jiveproperties read database table Ofproperty, get host, Set version, initialize PlugInManager, check the database. II. Load, Initialize, start module: model:initialize,start,stop,destroy,getname; Other interfaces: Serverfeaturesprovider, feature support, Iii. Basicmodule: Private domain name, stopping when stop and destroy.
1. Boot modules:
A) Routingtableimpl: all message routes.
b) Auditmanagerimpl: Achieve Auditmanager.
c) Rostermanager: all roster management.
d) Privatestorage: all privacy Management.
2. Core modules:
A) Presencemanagerimpl: all state management.
b) SessionManager: all Session management.
c) Packetrouterimpl: Transferred to Iqrouter, Messagerouter, Presencerouter.
d) Multicastrouter: Broadcast feature, routing packets with multiple addresses (addresses).
e) Packettransporterimpl: Transfer package: Packetdelivererimpl: Implement Packetdeliver, transfer processing; Transporthandler: Gateway processing.
f) Offlinemessagestrategy: Offline message policy. Offlinemessagestore: Store offline messages.
g) Vcardmanager: User card management.
3. Standard modules:
A) Iqhandler: all is given. Iqbindhandler: Processing binding resource request; Iqsessionestablishmenthandler: activating session after binding resource, Iqauthhandler: processing login request; Iqpinghandler: Handling Ping request ; Iqprivatehandler: Handling privacy requests; Iqprivacyhandler: Handling private list requests; Iqregisterhandler: processing registration requests; Iqrosterhandler: Processing roster Requests ; Iqtimehandler: Processing time request. Iqvcardhandler: Processing business card requests; Iqversionhandler: processing version requests; Iqlastactivityhandler: Handling Recent activity Requests ; Iqofflinemessageshandler: Processing get offline message request; Iqpephandler: handling public subscription requests; Iqpepownerhandler;iqsharedgrouphandler: Working with shared group requests ; Adhoccommandhandler: Processing command requests; Iqdiscoinfohandler;iqdiscoitemshandler.
b) Presencesubscriehandler: Processing status subscription requests. Presenceupdatehandler: Processing status requests.
c) Multicastdnsservice: Publish server information.
d) Defaultfiletransfermanager: Implement Filetransfermanager, manage file transfer; Filetransferproxy:
e) Mediaproxyservice: Multimedia Transfer Protocol for jingle use.
f) Stunservice: Point-to-point support.
g) Pubsubmodule:
h) Updatemanager: Check the server and plugin upgrade version.
i) Flashcrossdomainhandler:
j) Internalcomponentmanager: Managing Components.
k) Multiuserchatmanager: Manage multi-person chats.
L) Clearspacemanager:
m) Connectionmanagerimpl: Implements ConnectionManager to process connection requests.
N) Workgroupsupport: Working Group support Iv. Statisticsmanager,pubsubengine Monitoring service started. V. PlugInManager: monitor and load plug-ins in the plug-in directory.

5. Serving:
A) Login: ConnectionManager declares five connections: client, client SSL, external component, other server, Connection Manager, which have their own ports and can be disabled. Connectionmanagerimpl Create multiple Socketacceptor to listen on each port and bind different Connectionhandler: Manage Session, Create separate nioconnection and Stanzahandler and give the message to the latter, which creates different localsession. Client client SSL External component Connection Manager Socketaccepter Socketaccepter socketaccepter socketaccepter clien TCH clientch componentch multiplexerch clientsh clientsh componentsh multiplexersh lclients LClientS LComponentS LConnect Ionmultiplexers l*s Message path: (socketaccepter) iosession = > Connectionhandler = nioconnection, Stanzahandler = Packetrouter (Localsession), which is then routed separately by IQ, presence, and message.
b) iqrouter:routingtable, Multicastrouter, SessionManager, Usermanager, Iqhandler. The wrong package is given to the session received from SessionManager, broadcast to Multicastrouter, to the other person's package to Routingtable (error also routed to themselves), the rest to Iqhandler ( Find the only handler based on the namespace in the package).
c) presencerouter:routingtable (routing), Multicastrouter (broadcast), SessionManager (Error), Presencemanager (probing), Presenceupdatehandler (update), Presencesubscribehandler (subscription).
d) messagerouter:routingtable, Multicastrouter, SessionManager, Usermanager (judgment Registration), Offlinemessagestrategy (Save message).
e) Understanding of key classes:
I. Clientconnectionhandler: Responsible for monitoring the establishment of iosession, send and receive messages and shut down, and build conection and Stanzahandler, received messages to the latter, through the former to send messages.
II. Nioconnection: Save iosession that represents a connection to the user, send a message to the user, or use Packetdeliver to forward the message as an offline message store; it is usually used by the session.
Iii. Clientstanzahandler: First set up session (eventually sessionmanager create and inject connection), receive the message to Packetrouter processing. Iv. localclientsession: Save user information (Iqauthhandler processing login), set user status, send message to user, unified management by SessionManager.
f) Routing function class:
I. Multicastrouter: A package that broadcasts to the server and has a addresses element.
II. Routingtableimpl:routepacket forwards messages to user, component, server.
III. Iqhandler: Handling IQ Packs. Iqauthhandler handles user logins, Iqbindhandler handles resource bindings,
Iv. Presenceupdatehandler: Sets the user state via session. V. Presencesubscribehandler: Processing status Subscription package.
g) Manager class:
I. Rostermanager: Manage roster, each roster can broadcast user status to friends.
II. Privacylistmanager: Manage Privacylist, and if you do not block contacts, send them a status, and use Privacylistprovider to load the privacy list from the database.
III. Usermanager: Manage or create a user, change the password, and use Userprovider to load users ' information from the database.
Iv. Presencemanager: Manage the user's last active status and the user's status information on the downline.
V. Groupmanager: Use Groupprovider to manage user groups.
Vi. Vcardmanager: Use Vcardprovider to manage user business cards.
h) Factory class:
I. Authfactory: Can be equipped with Authprovider, verify the user login, obtain and decrypt the user password, log in will tell Usermanager through Userprovider load user.
i) Other classes:
I. Adminconsole: Get the program name and version, add the Delete module. Logic Brief: Connectionmanagerimpl as the last module is loaded, initialized and started, it uses Mina-core.jar in Socketacceptor, Iosession, Iohandler and so on to handle the underlying communication. Clientconnectionhandler is a iohandler that listens for user connection requests and establishes nioconnection with an open iosession (it calls iosession to send messages to the user) and Clientstanzahandler, which builds localclientsession and injects nioconnection through SessionManager for the user, and packet received from the user let Packetrouter forwarded to Iqrouter, Presencerouter and Messagerouter, error messages may be processed by sesssion to connection returned to the user, Successful processing allows Routingtableimpl to route to the recipient, Iqauthhandler handles the user login authentication package authentication then sets the session status to authenticated, the broadcast packet is handled by Multicastrouter, The query package is handled by the iqhandler of the corresponding namespace, and the status pack is handled by Presenceupdatehandler and Presencesubscribehandler. Message packets are typically routed to the recipient's session by the routepacket of Routingtable, and returned to Messagerouter routingfailed if the recipient is not logged in. It calls Offlinemessagestrategy to save as an offline message.

This document is included in the OpenFire group of a friend included in the class description

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.