001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ScaffoldEnvironmentContext.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.management.system;
030:
031: import java.util.List;
032: import java.util.Properties;
033: import java.util.logging.Logger;
034: import javax.management.MBeanServer;
035: import javax.management.MBeanServerFactory;
036: import com.sun.jbi.ComponentInfo;
037: import com.sun.jbi.ComponentManager;
038: import com.sun.jbi.ComponentQuery;
039: import com.sun.jbi.ComponentState;
040: import com.sun.jbi.ComponentType;
041: import com.sun.jbi.JBIProvider;
042: import com.sun.jbi.EnvironmentContext;
043: import com.sun.jbi.ServiceUnitRegistration;
044: import com.sun.jbi.StringTranslator;
045: import com.sun.jbi.component.InstallationContext;
046: import com.sun.jbi.management.MBeanHelper;
047: import com.sun.jbi.management.MBeanNames;
048: import com.sun.jbi.util.EnvironmentAccess;
049: import com.sun.jbi.wsdl2.WsdlFactory;
050: import com.sun.jbi.wsdl2.WsdlException;
051: import com.sun.jbi.management.registry.Registry;
052:
053: /**
054: * Provide local implementation of EnvironmentContext for testing.
055: * @author Sun Microsystems, Inc.
056: */
057: public class ScaffoldEnvironmentContext implements ComponentManager,
058: ComponentQuery, EnvironmentContext, StringTranslator
059:
060: {
061: private String mJbiInstallRoot;
062: private String mJbiInstanceRoot;
063: private final Logger mLogger;
064: private final MBeanServer mMBeanServer;
065: private final MBeanNames mMBeanNames;
066: private final MBeanHelper mMBeanHelper;
067: private Properties mProps;
068: private String mAppServerInstallRoot;
069: private String mAppServerInstanceRoot;
070: private ScaffoldPlatformContext mPlatform;
071: private Registry mRegistry;
072:
073: /**
074: * Dummy constructor.
075: */
076: public ScaffoldEnvironmentContext() {
077: EnvironmentAccess.setContext(this );
078: mLogger = Logger.getLogger(this .getClass().getName());
079: mPlatform = new ScaffoldPlatformContext();
080: mMBeanServer = MBeanServerFactory
081: .createMBeanServer("com.sun.jbi");
082: mMBeanNames = new com.sun.jbi.management.support.MBeanNamesImpl(
083: "com.sun.jbi", "server");
084: mMBeanHelper = new com.sun.jbi.management.support.MBeanHelper(
085: mMBeanServer, mMBeanNames, mLogger);
086: mProps = new Properties();
087: }
088:
089: /**
090: * Get the platform-specific context for this implementation.
091: * @return The PlatformContext.
092: */
093: public com.sun.jbi.platform.PlatformContext getPlatformContext() {
094: return mPlatform;
095: }
096:
097: /**
098: * A scaffolded component manager.
099: * @return a scaffolded component manager
100: */
101: public ComponentManager getComponentManager() {
102: return (ComponentManager) this ;
103: }
104:
105: /**
106: * Get a reference to the persisted JBI registry.
107: * @return Registry instance
108: */
109: public com.sun.jbi.registry.Registry getRegistry() {
110: return mRegistry;
111: }
112:
113: /**
114: * Get a read-only reference to the persisted JBI Registry. A DOM registry document
115: * object is returned.
116: * @return the registry document
117: */
118: public org.w3c.dom.Document getReadOnlyRegistry() {
119: // return null, if the DOM registry is needed then more stuff goes here
120: return null;
121: }
122:
123: /**
124: * Set a reference to JBI registry.
125: * @param Registry instance
126: */
127: public void setRegistry(Registry registry) {
128: mRegistry = registry;
129: }
130:
131: /**
132: * A scaffolded component query
133: * @return a scaffolded component query object
134: */
135: public ComponentQuery getComponentQuery() {
136: return (ComponentQuery) this ;
137: }
138:
139: /**
140: * A scaffolded component query
141: * @return a scaffolded component query object
142: */
143: public ComponentQuery getComponentQuery(String targetName) {
144: return (ComponentQuery) this ;
145: }
146:
147: /* methods from EnvironmentContext interface */
148:
149: /**
150: * Get the component ID of the current component.
151: * @return String containing the component ID.
152: */
153: public String getComponentId() {
154: return null;
155: }
156:
157: /**
158: * Get the component name of the current component.
159: * @return String containing the component name.
160: */
161: public String getComponentName() {
162: return null;
163: }
164:
165: /**
166: * Get the installation root directory of the specified Binding Component
167: * (BC) or Business Process Engine (BPE).
168: * @return String containing the installation root directory path
169: */
170: public String getComponentRoot() {
171: return null;
172: }
173:
174: /**
175: * Get the Connection Manager handle.
176: * @return The ConnectionManager instance.
177: */
178: public com.sun.jbi.messaging.ConnectionManager getConnectionManager() {
179: return null;
180: }
181:
182: /**
183: * Indicates whether or not the JBI framework has been fully started. This
184: * method provides clients with a way of determining if the JBI framework
185: * started up in passive mode as a result of on-demand initialization.
186: * The 'start' parameter instructs the framework to
187: * start completely if it has not already done so. If the framework has
188: * already been started, the request to start again is ignored.
189: * @param start requests that the framework start completely before
190: * returning.
191: * @return true if the framework is completely started, false otherwise.
192: */
193: public boolean isFrameworkReady(boolean start) {
194: return true;
195: }
196:
197: /**
198: * Get the MBeanNames service handle.
199: * @return MBeanNames the MBeanNames service
200: */
201: public MBeanNames getMBeanNames() {
202: return mMBeanNames;
203: }
204:
205: /**
206: * Get the MBeanHelper service handle.
207: * @return MBeanHelper the MBeanHelper service
208: */
209: public MBeanHelper getMBeanHelper() {
210: return mMBeanHelper;
211: }
212:
213: /**
214: * Get the MBean server used to register all MBeans in the JBI
215: * framework.
216: * @return javax.management.MBeanServer the MBean server
217: */
218: public javax.management.MBeanServer getMBeanServer() {
219: return mMBeanServer;
220: }
221:
222: /**
223: * Get the JNDI naming context.
224: * @return javax.naming.InitialContext the JNDI naming context
225: */
226: public javax.naming.InitialContext getNamingContext() {
227: return null;
228: }
229:
230: /**
231: * Get the Event Notifier instance.
232: * @return The EventNotifier instance.
233: */
234: public com.sun.jbi.framework.EventNotifierCommon getNotifier() {
235: return null;
236: }
237:
238: /**
239: * Gets the AppServer installation root directory.
240: * @return String the AppServer install root
241: */
242: public String getAppServerInstallRoot() {
243: return mAppServerInstallRoot;
244: }
245:
246: /**
247: * Gets the AppServer instance root directory.
248: * @return String the AppServer instance root
249: */
250: public String getAppServerInstanceRoot() {
251: return mAppServerInstanceRoot;
252: }
253:
254: /**
255: * Sets the AppServer install root directory.
256: * @param asInstallRoot the AppServer install root
257: */
258: public void setAppServerInstallRoot(String asInstallRoot) {
259: mAppServerInstallRoot = asInstallRoot;
260: }
261:
262: /**
263: * Sets the AppServer instance root directory.
264: * @param asInstanceRoot the AppServer instance root
265: */
266: public void setAppServerInstanceRoot(String asInstanceRoot) {
267: mAppServerInstanceRoot = asInstanceRoot;
268: }
269:
270: /**
271: * Gets the initial properties specified in the domain.xml file.
272: * @return java.util.Properties is the initial properties
273: */
274: public java.util.Properties getInitialProperties() {
275: return mProps;
276: }
277:
278: public void setProperty(String key, String value) {
279: mProps.setProperty(key, value);
280: }
281:
282: /**
283: * Get the ServiceUnitRegistration handle.
284: * @return the Service Unit registration instance.
285: */
286: public ServiceUnitRegistration getServiceUnitRegistration() {
287: return null;
288: }
289:
290: /**
291: * Get a StringTranslator for a specific package name.
292: * @param packageName - the name of the package for which a StringTranslator
293: * is being requested.
294: * @return The StringTranslator for the named package.
295: */
296: public StringTranslator getStringTranslator(String packageName) {
297: return (StringTranslator) this ;
298: }
299:
300: /**
301: * Get a StringTranslator for a specific object.
302: * @param object - the object for which a StringTranslator is being
303: * requested, using the name of the package containing the object.
304: * @return The StringTranslator for the object's package.
305: */
306: public StringTranslator getStringTranslatorFor(Object object) {
307: return (StringTranslator) this ;
308: }
309:
310: /**
311: * Get the VersionInfo for this runtime.
312: * @return The VersionInfo instance.
313: */
314: public com.sun.jbi.VersionInfo getVersionInfo() {
315: return (com.sun.jbi.VersionInfo) this ;
316: }
317:
318: /**
319: * Gets the logger for the framework.
320: * @return java.util.Logger is the logger
321: */
322: public Logger getLogger() {
323: return Logger.getLogger("com.sun.jbi.management");
324: }
325:
326: /**
327: * Get a handle to the class implementing management for the named
328: * JBI system service.
329: * @param aServiceName the service name
330: * @return Object is the class implementing manangment.
331: */
332: public Object getManagementClass(String aServiceName) {
333: return this ;
334: }
335:
336: /**
337: * Get the TransactionManager.
338: * @return TransactionManager instance.
339: */
340: public javax.transaction.TransactionManager getTransactionManager() {
341: return null;
342: }
343:
344: /**
345: * Sets the main MBean server for use by all components.
346: * @param mBeanServer is the MBean server
347: */
348: public void setMBeanServer(javax.management.MBeanServer mBeanServer) {
349: System.out.println("In scaffolded setMBeanServer.");
350: return;
351: }
352:
353: /* methods from ComponentManager interface */
354:
355: /**
356: * Get the javax.jbi.component.Component instance.
357: * @param name - the unique name of the component being retrieved.
358: * @return The instance for the requested component or null if the
359: * component is not registered or not active.
360: */
361: public javax.jbi.component.Component getComponentInstance(
362: String name) {
363: System.out.println("In scaffolded getComponentInstance.");
364: return null;
365: }
366:
367: /**
368: * Get the com.sun.jbi.framework.DeployerMBean instance.
369: * @param name - the unique name of the component.
370: * @return The instance for the requested component or null if the
371: * component is not registered or not active.
372: */
373: public com.sun.jbi.framework.DeployerMBean getDeployerInstance(
374: String name) {
375: System.out.println("In scaffolded getDeployerInstance.");
376: return null;
377: }
378:
379: /**
380: * Install a Shared Library into the JBI framework.
381: * @param id - the unique component ID assigned to the Shared Library.
382: * @param name - the unique name of the Shared Library.
383: * @param description - the description of the Shared Library.
384: * @param componentRoot - the root directory for the Shared Library.
385: * @param elements - the list of jar and class files included in this
386: * shared namespace, as a List of String objects in the order in which they
387: * should appear in the class path. Each list element contains the full
388: * path to either a jar file or a directory containing class files.
389: * @throws javax.jbi.JBIException if any error occurs.
390: */
391: public void installSharedLibrary(String id, String name,
392: String description, String componentRoot, List elements)
393: throws javax.jbi.JBIException {
394: System.out.println("In scaffolded installSharedLibrary.");
395: return;
396: }
397:
398: /**
399: * Install a Shared Library into the JBI framework.
400: * @param name - the unique component ID assigned to the Shared Library.
401: * @param description - the description of the Shared Library.
402: * @param componentRoot - the root directory for the Shared Library.
403: * @param isSelfFirst - set to true to force the class loader to use a
404: * self-first hierarchy, false for parent-first.
405: * @param elements - the list of jar and class files included in this
406: * shared namespace, as a List of String objects in the order in which they
407: * should appear in the class path. Each list element contains the full
408: * path to either a jar file or a directory containing class files.
409: * @throws javax.jbi.JBIException if any error occurs.
410: */
411: public void installSharedLibrary(String name, String description,
412: String componentRoot, boolean isSelfFirst, List elements)
413: throws javax.jbi.JBIException {
414: System.out.println("In scaffolded installSharedLibrary.");
415: return;
416: }
417:
418: /**
419: * Load a Component bootstrap into the JBI framework.
420: * @param installContext is the InstallationContext
421: * @param bootClassName is the name of the bootstrap class for the component
422: * @param bootClassPathElements is the list of elements comprising the
423: * class path for loading the bootstrap class
424: * @param snsIdList is the list of Shared Libraries required by the component
425: * @return javax.management.ObjectName containing the MBean object
426: * name and class name.
427: * @throws javax.jbi.JBIException if any error occurs.
428: */
429: public javax.management.ObjectName loadBootstrap(
430: InstallationContext installContext, String bootClassName,
431: List bootClassPathElements, List snsIdList)
432: throws javax.jbi.JBIException {
433: System.out.println("In scaffolded loadBootstrap.");
434: return null;
435: }
436:
437: /**
438: * Uninstall a Shared Library from the JBI framework. A Shared
439: * Namespace cannot be uninstalled until all dependent components
440: * have been uninstalled. If any dependent components are found,
441: * the uninstall of the Shared Library is aborted.
442: * @param name is the unique name of the shared namespace
443: * @throws javax.jbi.JBIException if any error occurs.
444: */
445: public void uninstallSharedLibrary(String name)
446: throws javax.jbi.JBIException {
447: System.out.println("In scaffolded uninstallSharedLibrary.");
448: }
449:
450: /**
451: * Unload a Component bootstrap from the JBI framework.
452: * @param componentName is the name of the component
453: * @throws javax.jbi.JBIException if any error occurs.
454: */
455: public void unloadBootstrap(String componentName)
456: throws javax.jbi.JBIException {
457: System.out.println("In scaffolded unloadBootstrap.");
458: return;
459: }
460:
461: /**
462: * Cancel a pending component update. This is called when some failure
463: * has occurred after <code>validateComponentForUpdate()</code> has already
464: * been called but before <code>updateComponent()</code> is called. All
465: * this method does is return the component to the <code>SHUTDOWN</code>
466: * state and remove the busy indicator from the component entry in the
467: * runtime registry cache.
468: * @param componentName The name of the component.
469: * @throws javax.jbi.JBIException if the component does not exist.
470: */
471: public void cancelComponentUpdate(String componentName)
472: throws javax.jbi.JBIException {
473: System.out.println("In scaffolded cancelComponentUpdate.");
474: }
475:
476: /**
477: * Update an installed component. This is used to replace the runtime
478: * jar files of a component with a newer version without requiring the
479: * component to be uninstalled (which requires undeployment of all Service
480: * Assemblies that have Service Units deployed to the component).
481: * @param installContext The installation context.
482: * @param bootClassPathElements A list of elements comprising the class
483: * path for loading the bootstrap class. Each element in the list is a
484: * String containing the full path to either a jar file or a directory
485: * containing class files.
486: * @throws javax.jbi.JBIException if the update fails for some reason.
487: */
488: public void updateComponent(
489: com.sun.jbi.component.InstallationContext installContext,
490: List bootClassPathElements) throws javax.jbi.JBIException {
491: System.out.println("In scaffolded updateComponent.");
492: }
493:
494: /**
495: * Validate a component for update. This is used to validate that the runtime
496: * jar files provided for the update contain valid implementations of the
497: * required interfaces and the component classes will load correctly.
498: * @param installContext The installation context.
499: * @param bootClassPathElements A list of elements comprising the class
500: * path for loading the bootstrap class. Each element in the list is a
501: * String containing the full path to either a jar file or a directory
502: * containing class files.
503: * @throws javax.jbi.JBIException if there is a problem with the updated
504: * component.
505: */
506: public void validateComponentForUpdate(
507: com.sun.jbi.component.InstallationContext installContext,
508: List bootClassPathElements) throws javax.jbi.JBIException {
509: System.out.println("In scaffolded validateComponentForUpdate.");
510: }
511:
512: /**
513: * Cancel a pending component upgrade. This is called when some failure
514: * has occurred after <code>validateComponentForUpgrade()</code> has already
515: * been called but before <code>upgradeComponent()</code> is called. All
516: * this method does is return the component to the <code>SHUTDOWN</code>
517: * state and remove the busy indicator from the component entry in the
518: * runtime registry cache.
519: * @param componentName The name of the component.
520: * @throws javax.jbi.JBIException if the component does not exist.
521: */
522: public void cancelComponentUpgrade(String componentName)
523: throws javax.jbi.JBIException {
524: System.out.println("In scaffolded cancelComponentUpgrade.");
525: }
526:
527: /**
528: * Upgrade an installed component. This is used to upgrade a component to a
529: * newer version without requiring the component to be uninstalled (which
530: * requires undeployment of all Service Assemblies that have Service Units
531: * deployed to the component). There are two ways a component can be updated.
532: * If the component does not provide an <code>upgrade()</code> method in its
533: * bootstrap class, then the runtime jar files are updated and any changes
534: * to the component's installation descriptor in jbi.xml are propagated. If
535: * the component provides an <code>upgrade()</code> method, that method is
536: * called to give the component the opportunity to upgrade its workspace
537: * and all SUs deployed to it to a new version. In this case, it is the
538: * responsibility of the component to perform all version verification, and
539: * to provide any recovery processing required in the event of a failed
540: * upgrade.
541: *
542: * @param installContext The installation context.
543: * @param bootClassPathElements A list of elements comprising the class
544: * path for loading the bootstrap class. Each element in the list is a
545: * String containing the full path to either a jar file or a directory
546: * containing class files.
547: * @throws javax.jbi.JBIException if the update fails for some reason.
548: */
549: public void upgradeComponent(
550: com.sun.jbi.component.InstallationContext installContext,
551: String bootClassName, List<String> bootClassPathElements,
552: List<String> sharedLibraryList)
553: throws javax.jbi.JBIException {
554: System.out.println("In scaffolded upgradeComponent.");
555: }
556:
557: /**
558: * Validate a component for upgrade. This validates that the runtime jar
559: * files provided for the upgrade contain valid implementations of the
560: * required interfaces and the component classes will load correctly. This
561: * also verifies that all Shared Library dependencies are met. It also
562: * determines whether or not the component has provided an implementation
563: * of the <code>upgrade()</code> method and returns an indicator of that to
564: * the caller.
565: *
566: * @param installContext The installation context.
567: * @param bootClassName The name of the bootstrap class for the component.
568: * @param bootClassPathElements A list of elements comprising the class
569: * path for loading the bootstrap class. Each element in the list is a
570: * String containing the full path to either a jar file or a directory
571: * containing class files.
572: * @param sharedLibraryList A list of String objects specifing the names of
573: * the Shared Libraries required by the component, in the order in which
574: * they should appear in the class path.
575: * @return <code>true</code> if the component provided an <code>upgrade()
576: * </code> method, <code>false</code> if not.
577: * @throws javax.jbi.JBIException if there is a problem with the component
578: * implementation classes or with Shared Library dependencies.
579: */
580: public boolean validateComponentForUpgrade(
581: com.sun.jbi.component.InstallationContext installContext,
582: String bootClassName, List<String> bootClassPathElements,
583: List<String> sharedLibraryList)
584: throws javax.jbi.JBIException {
585: System.out
586: .println("In scaffolded validateComponentForUpgrade.");
587: return true;
588: }
589:
590: /* methods from ServiceLifecycle interface */
591:
592: /**
593: * Initialize a service. This performs any initialization tasks
594: * required by the service but does not make the service ready
595: * to process requests.
596: * @param aContext the JBI environment context created
597: * by the JBI framework
598: * @throws javax.jbi.JBIException if an error occurs
599: */
600: public void initService(EnvironmentContext aContext)
601: throws javax.jbi.JBIException {
602: System.out.println("In scaffolded init.");
603: }
604:
605: /**
606: * Start a service. This makes the service ready to process requests.
607: * @throws javax.jbi.JBIException if an error occurs
608: */
609: public void startService() throws javax.jbi.JBIException {
610: System.out.println("In scaffolded start.");
611: }
612:
613: /**
614: * Stop a service. This makes the service stop processing requests.
615: * @throws javax.jbi.JBIException if an error occurs
616: */
617: public void stopService() throws javax.jbi.JBIException {
618: System.out.println("In scaffolded stop.");
619: }
620:
621: /**
622: * Get the management message factory which enables JBI components
623: * to construct status and exception messages.
624: * @return An instance of ManagementMessageFactory.
625: */
626: public com.sun.jbi.management.ManagementMessageFactory getManagementMessageFactory() {
627: System.out
628: .println("In scaffolded getManagementMessageFactory.");
629: return null;
630: }
631:
632: /* methods from ComponentQuery interface */
633:
634: /**
635: * Get a list of component IDs for all registered components of a specified
636: * type.
637: * @param type - the Component type: ComponentInfo.SHARED_NAME_SPACE,
638: * ComponentInfo.BINDING, ComponentInfo.ENGINE, ComponentInfo.ALL, or
639: * ComponentInfo.BINDINGS_AND_ENGINES. ComponentInfo.ALL includes all
640: * components regardless of their types. ComponentInfo.BINDINGS_AND_ENGINES
641: * includes both bindings and engines.
642: * @return A List of component IDs ( String ) of all registered components
643: * of the requested type. Returns an empty list of no components were found.
644: */
645: public List getComponentIds(ComponentType type) {
646: System.out.println("In scaffolded getComponentIds.");
647: return null;
648: }
649:
650: /**
651: * Get a list of component IDs for all components of a specified type with
652: * a specified status.
653: * @param type - the Component type: ComponentInfo.SHARED_NAME_SPACE,
654: * ComponentInfo.BINDING, ComponentInfo.ENGINE, ComponentInfo.ALL, or
655: * ComponentInfo.BINDINGS_AND_ENGINES. ComponentInfo.ALL includes all
656: * components regardless of their types. ComponentInfo.BINDINGS_AND_ENGINES
657: * includes both bindings and engines.
658: * @param status - the Component status: ComponentInfo.LOADED,
659: * ComponentInfo.INSTALLED, ComponentInfo.STARTED, or ComponentInfo.STOPPED.
660: * @return A List of component IDs ( String ) of all registered components
661: * of the requested type with the requested status. Returns an empty list if
662: * no components were found.
663: */
664: public List getComponentIds(ComponentType type,
665: ComponentState status) {
666: System.out.println("In scaffolded getComponentIds.");
667: return null;
668: }
669:
670: /**
671: * Get the ComponentInfo for a particular component.
672: * @param componentId - the unique ID of the component being retrieved.
673: * @return The ComponentInfo for the requested component or null if the
674: * component is not registered.
675: */
676: public ComponentInfo getComponentInfo(String componentId) {
677: System.out.println("In scaffolded getComponentInfo.");
678: return null;
679: }
680:
681: /**
682: * Get a list of component IDs that depend upon a specified Shared Library.
683: * @param snsId - the unique ID of the Shared Library.
684: * @return A list of the component IDs of all components that depend upon the
685: * Shared Library. If none are found, the list is empty.
686: */
687: public List getDependentComponentIds(String snsId) {
688: System.out.println("In scaffolded getComponentInfo.");
689: return null;
690: }
691:
692: /**
693: * Get the ComponentInfo for a particular shared library.
694: * @param sharedLibraryName - the unique name of the shared library being
695: * retrieved.
696: * @return The ComponentInfo for the requested shared library or null if the
697: * shared library is not registered.
698: */
699: public ComponentInfo getSharedLibraryInfo(String sharedLibraryName) {
700: System.out.println("In scaffolded getSharedLibraryInfo.");
701: return null;
702: }
703:
704: /**
705: * Get the current status of a component.
706: * @param componentId - the unique component ID.
707: * @return The current status of the component: ComponentInfo.INSTALLED,
708: * ComponentInfo.LOADED, ComponentInfo.STARTED, or ComponentInfo.STOPPED.
709: * For a Shared Library, the status is always ComponentInfo.INSTALLED.
710: * @throws javax.jbi.JBIException if the component ID is not registered.
711: */
712: public ComponentState getStatus(String componentId)
713: throws javax.jbi.JBIException {
714: System.out.println("In scaffolded getStatus.");
715: return ComponentState.STOPPED;
716: }
717:
718: /* methods from StringTranslator interface */
719:
720: /**
721: * Get a localized string using the specified resource key.
722: * @param key - the key to the localized string in the resource bundle.
723: * @return the localized string.
724: */
725: public String getString(String key) {
726: return "Scaffolded String is" + key;
727: }
728:
729: /**
730: * Get a localized string using the specified resource key. Handle one
731: * message insert.
732: * @param key - the key to the localized string in the resource bundle.
733: * @param insert1 - the message insert.
734: * @return the localized string formatted with the message insert.
735: */
736: public String getString(String key, Object insert1) {
737: return "Scaffolded String is" + key;
738: }
739:
740: /**
741: * Get a localized string using the specified resource key. Handle two
742: * message inserts.
743: * @param key - the key to the localized string in the resource bundle.
744: * @param insert1 - the first message insert.
745: * @param insert2 - the second message insert.
746: * @return the localized string formatted with the message inserts.
747: */
748: public String getString(String key, Object insert1, Object insert2) {
749: return "Scaffolded String is" + key;
750: }
751:
752: /**
753: * Get a localized string using the specified resource key. Handle three
754: * message inserts.
755: * @param key - the key to the localized string in the resource bundle.
756: * @param insert1 - the first message insert.
757: * @param insert2 - the second message insert.
758: * @param insert3 - the third message insert.
759: * @return the localized string formatted with the message inserts.
760: */
761: public String getString(String key, Object insert1, Object insert2,
762: Object insert3) {
763: return "Scaffolded String is" + key;
764: }
765:
766: /**
767: * Get a localized string using the specified resource key. Handle four
768: * message inserts.
769: * @param key - the key to the localized string in the resource bundle.
770: * @param insert1 - the first message insert.
771: * @param insert2 - the second message insert.
772: * @param insert3 - the third message insert.
773: * @param insert4 - the fourth message insert.
774: * @return the localized string formatted with the message inserts.
775: */
776: public String getString(String key, Object insert1, Object insert2,
777: Object insert3, Object insert4) {
778: return "Scaffolded String is" + key;
779: }
780:
781: /**
782: * Get a localized string using the specified resource key. Handle any
783: * number of message inserts.
784: * @param key - the key to the localized string in the resource bundle.
785: * @param inserts - the array of message inserts.
786: * @return the localized string formatted with the message inserts.
787: */
788: public String getString(String key, Object[] inserts) {
789: return "Scaffolded String is" + key;
790: }
791:
792: /**
793: * Return a String containing the result of a printStackTrace() on an
794: * exception.
795: * @param ex the exception for which a stack trace is requested.
796: * @return the stack trace in a String.
797: */
798: public String stackTraceToString(Throwable ex) {
799: return "";
800: }
801:
802: public JBIProvider getProvider() {
803: return JBIProvider.OTHER;
804: }
805:
806: public WsdlFactory getWsdlFactory() throws WsdlException {
807: return null;
808: }
809:
810: public String getJbiInstallRoot() {
811: return mJbiInstallRoot;
812: }
813:
814: public void setJbiInstallRoot(String jbiRoot) {
815: mJbiInstallRoot = jbiRoot;
816: }
817:
818: public String getJbiInstanceRoot() {
819: return mJbiInstanceRoot;
820: }
821:
822: public void setJbiInstanceRoot(String jbiRoot) {
823: mJbiInstanceRoot = jbiRoot;
824: }
825:
826: /**
827: * This method is used to scaffold EnvironmentContext.isStartOnDeployEnabled()
828: * and always returns true
829: */
830: public boolean isStartOnDeployEnabled() {
831: return true;
832: }
833:
834: /**
835: * This method is used to find out if start-onverify is enabled.
836: * When this is enabled components are started automatically when
837: * an application has to be verified for them
838: * This is controlled by the property com.sun.jbi.startOnVerify.
839: * By default start-on-verify is enabled.
840: * It is disabled only if com.sun.jbi.startOnVerify=false.
841: */
842: public boolean isStartOnVerifyEnabled() {
843: return true;
844: }
845: }
|