FITECH Laboratories spacer
graphic Company graphic Products graphic Support graphic Customers graphic Partners
The Power of Choice
spacer » Buy graphic » Try graphic » Map graphic » Contact graphic
spacer
spacer
xTier™
Overview
xTier™ Products
Business Case
Documentation
F.A.Q.
Buy xTier™
Try xTier™
Professional Services
graphic
spacer xTier
spacer
startup
Product: xTier™/LWC 2.3
Other Docs: n/a
spacer
 support@fitechlabs.com
 Download
 Buy
 Depends: n/a
 Related: n/a
xTier™ Navigator:
cache cluster config email i18n
ioc info jmx jndi security
log marshal objpool os fs
tx uidgen workflow jobs
db startup jms grid

Description
The 'startup' service instantiates specified startable instances on xTier™ startup. The startup is a special type of service - it starts always the last allowing user code to be executed explicitly after all other xTier™ services have been successfully started. This service is usually used to automatically launch user application code during xTier™ startup.

'startup' service is part of two-way non-intrusive integration facility provided by xTier™ in which user code can either be integrated into xTier™ (using startup service) or xTier™ can be integrated into hosting environment of user code (by using micro kernel).

 Top

Configuration
'startup' service uses notion of startable that is equivalent to any POJO in Java and specified as IoC descriptor in XML configuration. Startables specified in configuration are created automatically and can be accessed at runtime by their names. 'startup' service is configured via pre-defined xtier_startup.xml configuration file. This file follows standard xTier™ service configuration pattern that can be demonstrated by the following complete example of startup configuration (from examples):

1<xtier-startup>
2  <region name="examples">
3    <!-- Define startable instance. -->
4    <startable name="id">
5      <ioc policy="new">
6        <java class= "com.fitechlabs.xtier.examples.
7            services.startup.StartupClass">
8          <call method="start">
9          </call>
10        </java>
11      </ioc>
12    </startable>
13  <region name="examples">
14</xtier-startup>

Formal sepcification for this service configuration can be found in xtier_starup.dtd file in ${XTIER_ROOT}/config/dtd folder.

<startable> tag should include one <ioc> element. <ioc> tag is defined in %XTIER_ROOT%/config/dtd/xtier_dtd_includes.dtd, it points to startable class and can describe constructor, methods, invoked automatically after instance is created, and their parameters. See IocService for <ioc> tag usage details.

 Top

Examples
Usage of 'startup' service follows the standard pattern of using xTier™ service: you need to obtain an instance of xTier™ kernel that serves as a service registry. Once you have xTier™ kernel you can get an instance of any service, in our case the 'startup' service. Once the service instance is obtained the service API can be used. The following code snippet illustrates the basic usage pattern for the 'startup' service:

1// Get the instance of xTier kernel.
2XtierKernel xtier = XtierKernel.getInstance();
3 
4// Get the instance of 'startup' service.
5StartupService startup = xtier.startup();
6 
7// Get map of startables, defined in XML configuration, 
8// keyed by thier name.
9Map startables = startup.getStartables();
10 
11// Get specified startable instance by its unique name.
12Object startable = startup.getStartable("id"); 

 Download xTier™ for full examples and documentation.

 Top

spacer