⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 monitor.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
		Object module = getMonitor().findModule((Object) null,									  factoryInterface, (String) null);		return module;	}	/**		Boot or find a unidentified module within a service. This call allows modules		to start or create any modules they explicitly require to exist within		their service. If no module matching the criteria is found (see this class's prologue for details)		then an instance will be created (see prologue) and booted as follows.		<PRE>		((ModuleControl) instance).boot(create, (String) null, properties);		</PRE>		<BR>		The service is defined by the service that the module serviceModule lives in,		typically this call is made from the boot method of a module and thus		'this' is passed in for serviceModule.		@return a reference to a module.		@exception StandardException An attempt to start the module failed.	*/	public static Object bootServiceModule(boolean create, Object serviceModule,		String factoryInterface, Properties properties)		throws StandardException {		Object module = monitor.startModule(create, serviceModule, factoryInterface,						(String) null, properties);		if (SanityManager.DEBUG) {			SanityManager.ASSERT(module != null, "module is null - " + factoryInterface);		}		return module;	}	/**		Boot or find a identified module within a service. This call allows modules		to start or create any modules they explicitly require to exist within		their service. If no module matching the criteria is found (see this class's prologue for details)		then an instance will be created (see prologue) and booted as follows.		<PRE>		((ModuleControl) instance).boot(create, identifer, properties);		</PRE>		<BR>		The service is defined by the service that the module serviceModule lives in,		typically this call is made from the boot method of a module and thus		'this' is passed in for serviceModule.		@return a reference to a module.		@exception StandardException An attempt to start the module failed.	*/	public static Object bootServiceModule(boolean create, Object serviceModule,		String factoryInterface, String identifier, Properties properties)		throws StandardException {		Object module = monitor.startModule(create, serviceModule, factoryInterface, identifier, properties);				if (SanityManager.DEBUG) {			SanityManager.ASSERT(module != null, "module is null - " + factoryInterface);		}		return module;	}	/**		Find an unidentified module within a service.		<BR>		The service is defined by the service that the module serviceModule lives in.		@return a reference to a module or null if one cannot be found.	*/	public static Object findServiceModule(Object serviceModule, String factoryInterface)		throws StandardException {		Object module = getMonitor().findModule(serviceModule, factoryInterface, (String) null);		if (module == null)			throw Monitor.missingImplementation(factoryInterface);		return module;	}	public static Object getServiceModule(Object serviceModule, String factoryInterface)	{		Object module = getMonitor().findModule(serviceModule, factoryInterface, (String) null);		return module;	}	/**		Find an identified module within a service.		<BR>		The service is defined by the service that the module serviceModule lives in.		@return a reference to a module or null if one cannot be found.	*/	//public static Object findServiceModule(Object serviceModule, String factoryInterface, String identifier) {	//	return monitor.findModule(serviceModule, factoryInterface, identifier);	//}	/**		Find a service.		@return a refrence to a module represeting the service or null if the service does not exist.	*/	public static Object findService(String factoryInterface, String serviceName) {		return monitor.findService(factoryInterface, serviceName);	}	/**		Start a persistent service. The name of the service can include a		service type, in the form 'type:serviceName'.		<BR>		Note that the return type only indicates		if the service can be handled by the monitor. It does not indicate		the service was started successfully. The cases are		<OL>		<LI> Service type not handled - false returned.		<LI> Service type handled, service does not exist, true returned.		<LI> Service type handled, service exists and booted OK, true returned.		<LI> Service type handled, service exists and failed to boot, exception thrown.		</OL>		If true is returned then findService should be used to see if the service		exists or not.		@return true if the service type is handled by the monitor, false if it isn't		@exception StandardException An attempt to start the service failed.	*/	public static boolean startPersistentService(String serviceName, 												 Properties properties) 		throws StandardException {		if (SanityManager.DEBUG) {			SanityManager.ASSERT(serviceName != null, "serviceName is null");		}		return monitor.startPersistentService(serviceName, properties);	}	/**		Start a non-persistent service. 		<P><B>Context</B><BR>		A context manager will be created and installed at the start of this method and destroyed		just before this method returns.		@return The module from the service if it was started successfully. 		@exception StandardException An exception was thrown trying to start the service.	*/	public static Object startNonPersistentService(String factoryInterface, String serviceName, Properties properties)		throws StandardException {		if (SanityManager.DEBUG) {			SanityManager.ASSERT(factoryInterface != null, "serviceName is null");			SanityManager.ASSERT(serviceName != null, "serviceName is null");		}		return monitor.startNonPersistentService(factoryInterface, serviceName, properties);	}	/**		Create a named service that implements the java interface (or class) fully qualified by factoryInterface.		The Properties object specifies create time parameters to be used by the modules within the		service. Any module created by this service may add or remove parameters within the		properties object in their ModuleControl.boot() method. The properties set will be saved		by the Monitor for later use when the monitor is started.		<P><B>Context</B><BR>		A context manager will be created and installed at the start of this method and destroyed		just before this method returns.		@return The module from the service if it was created successfully, null if a service already existed. 		@exception StandardException An exception was thrown trying to create the service.	*/	public static Object createPersistentService(String factoryInterface, String serviceName, Properties properties) 		throws StandardException {		if (SanityManager.DEBUG) {			SanityManager.ASSERT(factoryInterface != null, "serviceName is null");			SanityManager.ASSERT(serviceName != null, "serviceName is null");		}				return monitor.createPersistentService(factoryInterface, serviceName, properties);	}    public static void removePersistentService(String name)        throws StandardException    {		monitor.removePersistentService(name);    }	/**		Obtain the class object for a class that supports the given identifier.		If no class has been registered for the identifier then a StandardException		is thrown with no attached java.lang exception (nextException).		If a problem loading or accessing the class is obtained then a StandardException		is thrown with the real java.lang exception attached.		@return a valid class object		@exception StandardException See text above.	*/	public static InstanceGetter classFromIdentifier(int identifier) 		throws StandardException {		return monitor.classFromIdentifier(identifier);	}	/**		Obtain an new instance of a class that supports the given identifier.		If no class has been registered for the identifier then a StandardException		is thrown with no attached java.lang exception (getNestedException).		If a problem loading or accessing the class or creating the object is obtained		then a StandardException is thrown with the real java.lang exception attached.		@return a reference to a newly created object		@exception StandardException See text above.	*/	public static Object newInstanceFromIdentifier(int identifier) 		throws StandardException {		return monitor.newInstanceFromIdentifier(identifier);	}	/* 	** Static methods for startup type exceptions.	*/		/**		return a StandardException to indicate that a module failed to		start because it could not obtain the version of a required product.		@param productGenusName The genus name of the product.		@return The exception.	*/	public static StandardException missingProductVersion(String productGenusName)	{		return StandardException.newException(SQLState.MISSING_PRODUCT_VERSION, productGenusName);	}	/**		return a StandardException to indicate a missing		implementation.		@param implementation the module name of the missing implementation.		@return The exception.	*/	public static StandardException missingImplementation(String implementation) 	{		return StandardException.newException(SQLState.SERVICE_MISSING_IMPLEMENTATION, implementation);	}	/**		return a StandardException to indicate that an exception caused		starting the module to fail.		@param t the exception which caused starting the module to fail.		@return The exception.	*/	public static StandardException exceptionStartingModule(Throwable t)	{		return StandardException.newException(SQLState.SERVICE_STARTUP_EXCEPTION, t);	}	public static void logMessage(String messageText) {		getStream().println(messageText);	}	public static void logTextMessage(String messageID) {		getStream().println(MessageService.getTextMessage(messageID));	}	public static void logTextMessage(String messageID, Object a1) {		getStream().println(MessageService.getTextMessage(messageID, a1));	}	public static void logTextMessage(String messageID, Object a1, Object a2) {		getStream().println(MessageService.getTextMessage(messageID, a1, a2));	}	public static void logTextMessage(String messageID, Object a1, Object a2, Object a3) {		getStream().println(MessageService.getTextMessage(messageID, a1, a2, a3));	}	public static void logTextMessage(String messageID, Object a1, Object a2, Object a3, Object a4) {		getStream().println(MessageService.getTextMessage(messageID, a1, a2, a3, a4));	}	/**	 *  Translate a localeDescription of the form ll[_CC[_variant]] to	 *  a Locale object.	 */	public static Locale getLocaleFromString(String localeDescription)								throws StandardException {		return monitor.getLocaleFromString(localeDescription);	}	/**		Single point for checking if an upgrade is allowed.		@return true a full upgrade has been requested, false soft upgrade mode is active.	 */	public static boolean isFullUpgrade(Properties startParams, String oldVersionInfo) throws StandardException {		boolean fullUpgrade = Boolean.valueOf(startParams.getProperty(org.apache.derby.iapi.reference.Attribute.UPGRADE_ATTR)).booleanValue();		ProductVersionHolder engineVersion = Monitor.getMonitor().getEngineVersion();		if (engineVersion.isBeta() || engineVersion.isAlpha()) {								if (!PropertyUtil.getSystemBoolean(Property.ALPHA_BETA_ALLOW_UPGRADE))			{				//  upgrade not supported for alpha/beta.				throw StandardException.newException(SQLState.UPGRADE_UNSUPPORTED,						oldVersionInfo, engineVersion.getSimpleVersionString());			}		}		return fullUpgrade;	}	/**	  *	  *	@param	startParams			startup parameters	  *	@param	desiredProperty		property we're interested in	  *	  *	@return	true		type is as desired.	  *			false		otherwise	  *	  */	public static boolean isDesiredType(Properties startParams, int desiredProperty )	{		boolean	retval = false;		int		engineType = EngineType.NONE;		if ( startParams != null )		{			engineType = Monitor.getEngineType( startParams );		}		return (engineType & desiredProperty) != 0;	}	public static boolean isDesiredType(int engineType, int desiredProperty) {		return (engineType & desiredProperty) != 0;	}		/**	  *	@param	startParams		startup parameters	  *	  *	@return	type of engine	  *	  */	static	public	int	getEngineType(Properties startParams)	{		if ( startParams != null )		{			String etp = startParams.getProperty(EngineType.PROPERTY);			int engineType = etp == null ? EngineType.STANDALONE_DB : Integer.parseInt(etp.trim());			return engineType;		}		return EngineType.STANDALONE_DB;	}	/**	  Return true if the properties set provided contains	  database creation attributes for a database	  of the correct type	  */	public static boolean isDesiredCreateType(Properties p, int type)	{		boolean plainCreate = Boolean.valueOf(p.getProperty(Attribute.CREATE_ATTR)).booleanValue();		if (plainCreate) {			return (type & EngineType.NONE) != 0;		}		// database must already exist		return isDesiredType(p, type);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -