Hi Nader,

Here is my understanding of how it works:

Merlin looks at the provided block.xml file, and builds a list of
components to deploy.  These components come from the component
declarations in the block.xml, the component declarations in any
block.xml files in included blocks, and any components discovered in the
classpath that are needed to resolve unspecified dependencies of those
components.

The end result is a directed graph of components, where a component's
dependencies are lifecycled before the component itself.

The other factor on whether a component is initially lifecycled is it's
activation attribute.  Components with activation="startup" are
lifecycled automatically by the container on startup whereas components
that are "lazy" are only lifecycled when they are requested.

So, looking at the block.xml you provided, it looks like Merlin would
attempt to lifecycle the IMServer component on startup, which would
trigger a chain of other components as IMServer's dependencies, and the
dependencies dependencies and so on are lifecycled.

Hope that helps (and I hope its accurate ;-) ),

-Cameron
 
On Fri, 2004-04-09 at 09:23, Nader Aeinehchi wrote:
> Hi
> Thanks for the tips, but so far I have not managed to understand it.
> How does Merlin decide what to start when it reads a block.xml that
> contains several components and services?
> In a simple Java application, there is main method that is the entry
> point for the application.  I would assume that Merlin is a container
> that deploys several components and services, but somewhere in the
> process, there should
> 
> be something that resembles a main method.  How does Merlin manage
> that?
> As it comes to OpenIM, I am trying to learn Merlin by looking at the
> source code and configuration of OpenIM.
> The way I can see, it starts a .bat file that in turn starts
> merlin.bat.  It supplies merlin.bat with a jar-file, kernel.xml and
> config.xml.  I could not find any thing special in those xml-files,
> but I guess the real story is hidden somewhere
> 
> in the block.xml?  Certainly, CLI is involved here.
> BTW, I am running Merlin 3.3.
> Thanks.
> Best Regards
>  
> --
> Nader Aeinehchi
> Aasenhagen 66 E
> 2020 Skedsmokorset
> NORWAY
> Direct and Mobile +47 41 44 29 57
> Tel (private): +47 64 83 09 08
> Fax +47 64 83 08 07
> www.aeinehchi.com
>   ----- Original Message ----- 
>   From: Nader Aeinehchi 
>   To: [EMAIL PROTECTED] 
>   Sent: Friday, April 09, 2004 2:11 PM
>   Subject: Entry point in block.xml in Merlin
>   Hi
>   I am trying to understand what the entry point in a block.xml is. 
>   For example, I looket at OpenIM that is built upon Merlin. OpenIM is
> launched with:
>   merlin .... openim\jars\openim-server-impl-1.2.jar
>   Now when I look at the block.xml filen within the above jar file, I
> find lots of component definition, but I cannot see which component is
> launched first.
> 
>   Please help.
>   Thanks.
>   See the enclosed block.xml from openim.
>   Best Regards
>    
>   --
>   Nader Aeinehchi
>   Aasenhagen 66 E
>   2020 Skedsmokorset
>   NORWAY
>   Direct and Mobile +47 41 44 29 57
>   Tel (private): +47 64 83 09 08
>   Fax +47 64 83 08 07
>   www.aeinehchi.com
>   <container name="openim">
>      <services>
>        <service type="net.java.dev.openim.SimpleMessageRouter">
>          <source>SimpleMessageRouter</source>
>        </service>
>      </services>
>      <categories>
>        <category name="threads/classloader/scanner" priority="ERROR"/>
>      </categories>
>      <!--
>      Block implementation.
>      -->
>      <classloader>
>        <classpath>
>          <repository>
>              <!-- OpenIM -->
>              <resource id="openim:openim-server-api" version="1.2"/>
>              <resource id="openim:openim-storage-api" version="1.2"/>
>              <resource id="openim:openim-storage-impl" version="1.2"/>
>              <resource id="openim:openim-users-manager-api"
> version="1.3"/>
>              <resource id="openim:openim-users-manager-impl"
> version="1.3"/>
>              
>              <!-- XPP -->
>              <resource id="kxml2:kxml2" version="2.1.8"/>
>          
>              <!-- Commons -->
>              <resource id="commons-lang:commons-lang"
> version="1.0.1"/>
>              <resource id="commons-collections:commons-collections"
> version="2.1"/>
>              <!-- Avalon -->
>              <resource id="avalon-framework:avalon-framework-api"
> version="4.1.5"/>
>              <resource id="avalon-framework:avalon-framework-impl"
> version="4.1.5"/>
>              
>              <!-- Cornerstone -->
>              <resource
> id="cornerstone-threads:cornerstone-threads-api" version="1.0"/>
>              
>              <resource
> id="cornerstone-sockets:cornerstone-sockets-api" version="1.0"/>
>              
>              <resource
> id="cornerstone-connection:cornerstone-connection-api" version="1.0"/>
>              <resource
> id="cornerstone-connection:cornerstone-connection-impl"
> version="1.0"/>
>              
>              <resource
> id="cornerstone-scheduler:cornerstone-scheduler-api" version="1.0"/>
>              
>              <resource
> id="cornerstone-datasources:cornerstone-datasources-api"
> version="1.0"/>
>              
>              <!-- Excalibur -->
>              <resource id="excalibur-pool:excalibur-pool"
> version="1.2"/>
>              <resource id="excalibur-thread:excalibur-thread"
> version="1.1.1"/>
>              <resource id="excalibur:excalibur-collections"
> version="1.0"/>
>              <resource id="excalibur:excalibur-io" version="1.1"/>
>              <resource id="excalibur-concurrent:excalibur-concurrent"
> version="1.0"/>
>              <!-- XStream -->
>              <resource id="xstream:xstream" version="0.3"/>
>           </repository>
>        </classpath>
>      </classloader>
>      <include name="threads"
>          id="cornerstone-threads:cornerstone-threads-impl"
>          version="1.0"/>
>      <include name="sockets"
>          id="cornerstone-sockets:cornerstone-sockets-impl"
>          version="1.0">
>         <target path="manager">
>           <configuration>
>               <server-sockets>
>                   <factory name="plain"
>                      
> class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"/>
>                   <factory name="secure"
>                      
> class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory" >
>                      <ssl-factory>
>                       <keystore>
>                         <file>conf/keystore</file> <!-- keystore file
> location -->
>                         <password>openim</password> <!-- Key Store
> file password, only used to check keystore integrity -->
> 
>                         <key-password>openim</key-password> <!-- Only
> required when you need to decrypt a private key -->
> 
>                         <type>JKS</type> <!-- Key Store file format,
> defaults to JKS -->
>                         <algorithm>SunX509</algorithm> <!--
> Cryptography provider ID, defaults to SunX509 -->
>                      </keystore>
>                      <!-- SSL protocol to use, defaults to TLS,
> another possible value is SSL -->
>                      <protocol>TLS</protocol>
>                    </ssl-factory>
>                      <timeout>0</timeout>
>                      <!-- With this option set to a non-zero timeout,
> a call to
>                        accept() for this ServerSocket will block for
> only this amount of
>                        time. If the timeout expires, a
> java.io.InterruptedIOException is
>                        raised, though the ServerSocket is still valid.
> Default value is 0. -->
>                      <authenticate-client>false</authenticate-client>
>                      <!-- Whether or not the client must present a
> certificate to
>                         confirm its identity. Defaults to false. -->
>                    </factory>                    
>               </server-sockets>
>               <client-sockets>
>                   <factory name="plain"
>                      
> class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory"/>
>               </client-sockets>
>           </configuration>
>         </target>       
>      </include>
>      <include name="scheduler"
>          id="cornerstone-scheduler:cornerstone-scheduler-impl"
>          version="1.0"/>
>      <include name="datasources"
>          id="cornerstone-datasources:cornerstone-datasources-impl"
>          version="1.0"/>
>     <include name="storage"
>           id="openim:openim-storage-impl" version="1.2"/>
>      
>     <include name="users-manager"
>           id="openim:openim-users-manager-impl" version="1.3"/>
>           
>      
>      <component name="IMServer"
> class="net.java.dev.openim.IMServerImpl" activation="startup"/>
>      <component name="ServerParameters"
> class="net.java.dev.openim.ServerParametersImpl" activation="lazy"/>
>      <component name="IMConnectionHandler"
> class="net.java.dev.openim.IMConnectionHandlerImpl"
> activation="lazy"/>
>      <component name="IMPresenceHolder"
> class="net.java.dev.openim.IMPresenceHolderImpl" activation="lazy"/>
>      <component name="IMRouter"
> class="net.java.dev.openim.IMRouterImpl" activation="lazy"/>
>      <component name="S2SConnectorManager"
> class="net.java.dev.openim.S2SConnectorManagerImpl"
> activation="lazy"/>
>      <component name="S2SConnector"
> class="net.java.dev.openim.S2SConnectorImpl" activation="lazy"/>
>      <component name="SubscriptionManager"
> class="net.java.dev.openim.SubscriptionManagerImpl"
> activation="lazy"/>
>      <component name="ModuleManager"
> class="net.java.dev.openim.ModuleManagerImpl" activation="lazy"/>
>      <component name="SimpleMessageRouter"
> class="net.java.dev.openim.SimpleMessageRouterImpl"
> activation="lazy"/>
>        
>      <component name="SessionsManager"
> class="net.java.dev.openim.session.SessionsManagerImpl"
> activation="lazy"/>
>      <component name="IMClientSession"
> class="net.java.dev.openim.session.IMClientSessionImpl"
> activation="lazy"/>
>      <component name="IMServerSession"
> class="net.java.dev.openim.session.IMServerSessionImpl"
> activation="lazy"/>
>      <component name="User"
> class="net.java.dev.openim.data.jabber.UserImpl" activation="lazy"/>
>      <component name="UsersManager"
> class="net.java.dev.openim.data.UsersManagerImpl" activation="lazy"/>
>      <component name="Streams"
> class="net.java.dev.openim.jabber.StreamsImpl" activation="lazy"/>
>      <component name="Error"
> class="net.java.dev.openim.jabber.ErrorImpl" activation="lazy"/>
>      
>      <component name="client.Body"
> class="net.java.dev.openim.jabber.client.BodyImpl" activation="lazy"/>
>      <component name="client.Iq"
> class="net.java.dev.openim.jabber.client.IqImpl" activation="lazy"/>
>      <component name="client.Message"
> class="net.java.dev.openim.jabber.client.MessageImpl"
> activation="lazy"/>
>      <component name="client.Presence"
> class="net.java.dev.openim.jabber.client.PresenceImpl"
> activation="lazy"/>
>      <component name="client.Priority"
> class="net.java.dev.openim.jabber.client.PriorityImpl"
> activation="lazy"/>
>      <component name="client.Show"
> class="net.java.dev.openim.jabber.client.ShowImpl" activation="lazy"/>
>      <component name="client.Status"
> class="net.java.dev.openim.jabber.client.StatusImpl"
> activation="lazy"/>
>      <component name="client.Subject"
> class="net.java.dev.openim.jabber.client.SubjectImpl"
> activation="lazy"/>
>      <component name="client.Thread"
> class="net.java.dev.openim.jabber.client.ThreadImpl"
> activation="lazy"/>
>      
>      <component name="iq.auth.Digest"
> class="net.java.dev.openim.jabber.iq.auth.DigestImpl"
> activation="lazy"/>
>      <component name="iq.auth.Password"
> class="net.java.dev.openim.jabber.iq.auth.PasswordImpl"
> activation="lazy"/>
>      <component name="iq.auth.Query"
> class="net.java.dev.openim.jabber.iq.auth.QueryImpl"
> activation="lazy"/>
>      <component name="iq.auth.Resource"
> class="net.java.dev.openim.jabber.iq.auth.ResourceImpl"
> activation="lazy"/>
>      <component name="iq.auth.Username"
> class="net.java.dev.openim.jabber.iq.auth.UsernameImpl"
> activation="lazy"/>
>      
>      <component name="iq.browse.Query"
> class="net.java.dev.openim.jabber.iq.browse.QueryImpl"
> activation="lazy"/>
>      <component name="iq.search.Query"
> class="net.java.dev.openim.jabber.iq.search.QueryImpl"
> activation="lazy"/>
>      
>      <component name="iq.oob.Query"
> class="net.java.dev.openim.jabber.iq.oob.QueryImpl"
> activation="lazy"/>
>      
>      <component name="iq.jprivate.Query"
> class="net.java.dev.openim.jabber.iq.jprivate.QueryImpl"
> activation="lazy"/>
>      
>      <component name="iq.register.Password"
> class="net.java.dev.openim.jabber.iq.register.PasswordImpl"
> activation="lazy"/>
> 
>      <component name="iq.register.Query"
> class="net.java.dev.openim.jabber.iq.register.QueryImpl"
> activation="lazy"/>
>      <component name="iq.register.Username"
> class="net.java.dev.openim.jabber.iq.register.UsernameImpl"
> activation="lazy"/>
> 
>      <component name="iq.register.Remove"
> class="net.java.dev.openim.jabber.iq.register.RemoveImpl"
> activation="lazy"/>
>      <component name="iq.roster.Group"
> class="net.java.dev.openim.jabber.iq.roster.GroupImpl"
> activation="lazy"/>
>      <component name="iq.roster.Item"
> class="net.java.dev.openim.jabber.iq.roster.ItemImpl"
> activation="lazy"/>
>      <component name="iq.roster.Query"
> class="net.java.dev.openim.jabber.iq.roster.QueryImpl"
> activation="lazy"/>
>      <component name="iq.vcardtemp.VCard"
> class="net.java.dev.openim.jabber.iq.vcardtemp.VCardImpl"
> activation="lazy"/>
>      <component name="server.Body"
> class="net.java.dev.openim.jabber.server.BodyImpl" activation="lazy"/>
>      <component name="server.Error"
> class="net.java.dev.openim.jabber.server.ErrorImpl"
> activation="lazy"/>
>      <component name="server.Iq"
> class="net.java.dev.openim.jabber.server.IqImpl" activation="lazy"/>
>      <component name="server.Message"
> class="net.java.dev.openim.jabber.server.MessageImpl"
> activation="lazy"/>
>      <component name="server.Presence"
> class="net.java.dev.openim.jabber.server.PresenceImpl"
> activation="lazy"/>
>      <component name="server.Priority"
> class="net.java.dev.openim.jabber.server.PriorityImpl"
> activation="lazy"/>
>      <component name="server.Show"
> class="net.java.dev.openim.jabber.server.ShowImpl" activation="lazy"/>
>      <component name="server.Status"
> class="net.java.dev.openim.jabber.server.StatusImpl"
> activation="lazy"/>
>      <component name="server.Subject"
> class="net.java.dev.openim.jabber.server.SubjectImpl"
> activation="lazy"/>
>      <component name="server.Thread"
> class="net.java.dev.openim.jabber.server.ThreadImpl"
> activation="lazy"/>
>          
>      <component name="server.dialback.Result"
> class="net.java.dev.openim.jabber.server.dialback.ResultImpl"
> activation="lazy"/>
> 
>      <component name="server.dialback.Verify"
> class="net.java.dev.openim.jabber.server.dialback.VerifyImpl"
> activation="lazy"/>
> 
>      
>      <component name="MessageLogger"
> class="net.java.dev.openim.log.MessageLoggerImpl" activation="lazy"/>
>      <component name="MessageRecorder"
> class="net.java.dev.openim.log.MessageRecorderImpl"
> activation="lazy"/>
>      
>   </container>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to