OMG CORBA Component Technology System (4)
Author: Yu Jia
Email: jia_yu@263.net
[All rights reserved of any form of copying and reference must be licensed]
(3) CCM service
CCM application servers provide the following services for components:
§ Transaction Services
§ Security Services (Security Services)
§ Name Service (Naming Service)
§ Persistent service (persistence)
§ Resource Management (Resource Management)
(3.1) Transaction service
CCM supports two transaction management: container management and artificial self-management. The container management transaction requires only the component deployment description file, which is completely completed by the container, easy to use; manually self-administrative transaction uses the container's useertransaction interface or directly call transaction services, requires programming.
Container management transactions can change the transaction policies of the components and operations for fine-tuning, policy definitions with Enterprise JavaBean specification, the following table is the CORBA policy attribute and its role:
Attributes
Description
When the NOT Supported Call program calls a method, the transaction of the calling program is suspended, and the method is recovered. The Required component requires a current transaction to execute. If the call program provides a transaction environment, the caliber is configured in the transaction environment of the call; if the calling program is not in the transaction environment, the container starts a new transaction when the transaction begins, and is submitted to the transaction when the operation is completed. Supports If the caller provides a transaction environment, the caliber is an integral part of the calling program transaction environment; if the calling program is not in the transaction environment, the operation is performed outside of the transaction. The RequiresNew component requires its own transaction to execute. If the call program provides a transaction environment, the transaction of the calling program will be suspended and a new transaction is created for the implementation of the method. If the calling program does not provide a transaction environment, the performance of the container creates a new transaction. The calling program must be in the transaction environment before the MANDATory component is called. Armed into an integral part of the calling program transaction environment. If the calling program does not provide a transaction environment, the container issues a Transaction_Required CORBA exception information. Never If the caller provides a transaction environment, the container issues an Invalid _Trans Action CORBA unusual information; if the call does not provide a transaction environment, the container will not start a new transaction.
(3.2) Security services
Safety strategies are equally implemented to various components. The security policy of the container depends on the security of CORA, obtains a policy description from the configuration description, and checks the active certificate for the call operation. Security policies have been valid until other components that contain different strategies are called.
Access licenses are defined in component-related deployment descriptions. The granularity of the license must be consistent with the CORBA security mechanism deployed because it is used as an inspection when the operation is called. Access license can be defined in any component port, of course, also includes a component of the component.
(3.3) Event service
The CCM component transmits and accepts events using a simple CORBA notification service. This subset can be described by the following attributes:
§ Implementors and components of components represent the value type (ValueTypes);
§ The event data structure is mapped to the ANY of the structured event, rendering to the CORBA notification, or receives from it; the fixed portion of the structured event is sent to the event data structure, and the event data structure is removed from the event data structure when receiving;
§ The event is transactional and security, and the security policy related to the component event interface is defined in the deployment description;
§ Channel management container is implemented, not a component;
§ Filter management and setting instead of components by container;
Because event events may be both customer sending and receiving, it is also possible that the implementation of the component, so the operation of transmitting and receiving events is generated by the component IDL specification. The container maps these operations to the CORBA notification service.
(3.4) Naming Service
You can find the CORBA name service or trading service (if you are using the original FIND_BY_PRIMARY_KEY method to locate the entity component using the original FIND_BY_PRIMARY_KEY method; And nothing to find.
(3.5) Persistent service
CCM supports the Persistent State Service, PSS, PSS operating mode with container management persistence and artificial self-management persistence. When using the container management persistence, the programmer must use the OMG PSDL (a subset of the persistence definition language, a subset of OMG IDL), and the process of saving and recovering the status in the activation / sleep cycle is for programmers. It is completely transparent. When using artificial self-management persistence, the programmer must save the component state before the component is called by the container, and is restored from the sleep before the method is executed.
(3.6) Management server-side resources
From an architecture perspective, a typical CCM application includes a set of component plants that create a component instance in accordance with the request, such as e-commerce applications, may include consumer components, purchases, and payment components. Every consumer in the database has a corresponding consumer component instance, and the purchase car instance is created when each consumer is purchased (a specific time period), the payment component instance is the "Payment" button in the consumer. One moment.
CORBA instance components and process components are permanent components that extend to multiple calls because all customers should call components instance operations at any time at any time without component activation and sleep, and even the server crashes when the server crashes. The call request can be submitted.), So the creation and destruction of each component instance is visible to the client, and the activation and sleep of the component instance can only be visible.
Therefore, for thousands of consumers in the database, the CCM manages these instances. When the call request arrives, the task is hibernated, but the client, the consumer component has been running. This optimizes the runtime resources, enhances large-scale application software systems (such as various scale e-commerce systems) load processing capabilities, which can be found in the market potential of CCM components.
In addition to "activation every time you call" mode, CCM has other four resource allocations.
(4) CCM component type
CCM divides the components into four categories:
§ Service Components
§ Session components (session components)
§ Process Components
§ Entity Components, the service components and session components have a temporary component reference, that is, if the server process terminates and the server restart, the reference will be invalid, the service component, and the session component are for short, including Operation or function. In contrast, the process and physical component can only be invalid in the case where the customer's deletion command is deleted and the security policy is allowed, otherwise the component reference can be accessed even if the server is restarted. Therefore, process components and physical components are suitable for long-acting records and functions, such as consumer files and bank accounts.
The shortest life period of the service component is ended. It is ended, for example, for the complete process of payment of goods in the purchase vehicle: paying attention to the goods project from the order, accounting on the consumer's credit card, for the transportation department Preparation. Since the service components have the least resources, the highest efficiency is the highest, the service components are maximized on the component server. In addition, the "disposable" function in the process member and the physical member should also be loaded into a service component.
The session component can be called multiple times, but it is not continuously stored in the server: After the server is stopped, the component does not exist. The session component is only used in some temporary functions.
Process components define a process of starting and ending, such as an application for a bank account. The component is permanently reliable during the process, even if the server is stopped, the process continues by calling, destroying the component instance and release resources at the end of the process.
The physical component is a true permanent component, such as consumer information, account information, and the like to define a physical component. Typically physical components are stored in the database, communicate through the backend CORBA persistence status service and database, the front end is the component interface for the application. Each physical component has a keyword as a basis for the component retrieval.
The resource allocation of the CCM server is based on component-based categories. The stronger the above category is stronger, the more resources are occupied. In the application design phase, a reasonable split member is considered, and the previous component type is used as much as possible without loss of reliability, enhances the load capacity of the server.
Create a CCM component
In order to define components in CCM, the developer of the component needs to be defined as follows:
§ Component interface
§ Port of the main interface
§ component implementation
§ configuration file
§ Deployment Description
(1) component interface
The component interface is written with OMG IDL and CIDL (Component Implementation Definition Language, component implementation definition language), and the function is presented to the client's call program. The interface is a syntax contract between the client and the component, which is a list of functions, and does not describe the implementation method of the function. The CCM compiler declares the skeleton of the generating member from the interface of the component.
(2) Port of the main interface
The primary interface presents the life cycle method of the component. CCM automatically generates methods of creating and removing server components, because the default build program (constructor) is automatically created, only you need to add your special components, the component will record your extension.
Factory and Search Method: When using service components and session components, the client will use the factory method record to create a new instance file, and the factory returns the instance of the component to the client. The use of reference is an effective means of using a service component, which is also a major means of repeating the calling session components. Although the factory method is also a method of creating plant components and physical components, but for existing entity components, it is necessary to pass on the client. Search cases, use CCMs to operate the positioning member in the component Ben. The process component requires a client to save a reference for later use, which can be stored in the client's cookie, or in a naming or trader service. (3) Realization of components
CCM implementation class must be implemented:
§ All methods for remote interface description;
§ Operations defined in the primary interface (except for default build programs Constructor and destruction program DEStructor);
§ The callback method defined in the CCM specification, CCM container manages the enterprise component by calling these methods, and interacts with them.
(4) Deployment Description (Descriptor)
Each CCN requires a deployment description file. The CIDL compiler will automatically generate a file outline, but you need to fill in the details. Deployment Description Use XML, most of which is generated by the tool. The description document describes the types of containers required for components, as well as strategies for services, security, threads, and other containers.
(5) Property file
Feature file description components and properties of the original, attribute is the installation information of the component and the original. CCM Specifications Describe the format and usage of the feature file, which may be overwritten at the assembly.
(6) Committed description
The integrated body is partially combined with components in the application of components, rather than intact applications. If you want to sell the integration of the CCM component as product sales, you must establish a collection of aggregates.
(7) Error handling
The component and the application are not the same in the error handling method. First, we must realize that any error is to be properly handled in the component, it will affect the client that calls the method, so the information accepted by the client should be unfair. In addition, since the client does not know the logical operation of the component, the display error message must reflect the failed transaction environment, which is handled and explained by the client. Below is the main error handling technology of CCM:
Internal error handling; handle errors in CCM and in applications. One method accidentally generates errors, if the error program processing is not obtained, will bring the crash of the call application. Therefore, it is necessary to intercept the error, evaluate the severity of the error, take correction action; the result is not more than two: Either correct error, resumes continued from failure, either returning the relevant exception information to call customers.
Turn the error to the customer; to return the error to the user, you must first define an abnormality in the IDL of the component, or the exception is the standard exception of CORBA. The customer is a chance to deal with the exception in the TRY / CATCH cycle package (WRAP) call. CCM's error message to customers should be easy to understand, and have the ability to process, and most of them are wrong, inconsistent, over-range parameter values, or erroneous operation sequences.
Submit an error with the error handler; you need to write an error handling software to solve the "unknown" error, provide an error message to the customer as much as possible, a normal "unnexpected error" information is not repaired, at least failed method name and delivery Parameters. Handling the error of other components; if the component calls a third-party CCM component, all known and unknown errors generated by the next level component should be processed, because your component customers don't know the dependence of the components used and other components, either Write clear in the text, or handle problems yourself.
(8) thread
The EJB architecture is responsible for managing concurrency, do not manage threads and threads you, otherwise you will interfere with thread management of the EJB server, and the EJB server is free to use multiple JVMs, your thread management does not work correctly.
Role in CCM development and deployment
CCM Specifications Define all kinds of roles during application system development and deployment:
§ Component Developers (Component Developers)
§ Application Assemblers
§ Application deployers (Application Deployers)
§ Server Provider (Server Providers)
§ Container Provider (Container Providers)
§ Administrators
(1) Component developers (Component Developers Application Assemblers)
The component developer's task is to define a remote interface, primary interface, component implementation class, and deployment description. The writing tools they use are OMG IDL, OMG PSDL (Persistent State Definition Language, Persistent Status Definition Language), and OMG CIDL (Component IMplementation) Definition Language, Component Implementation Language , Skeleton, generated code, resource trigger code, and persistent management, code execution business rules inserted in these files (compiled into code), with the support of component container operators, developers Package these implementation code and configuration files, and the feature file is packaged into a package.
(2) Application integral personnel
There are two places to need integration: first need to commercialize the collection of multiple components, component integration as a unit of sales. Secondly, users buy independent components, but need to be integrated with third-party components and users their own components.
(3) Application deployment personnel
Applers are deployed to CCM-identified application servers after completing the modification of deployment description files. Deployment Settings Some are overwritten at runtime, and some can only be configured at runtime.
(4) Server provider
Provide application server implementation according to CCM specifications.
(5) container provider
The task of the container provider is to write a container that houses the CCM component, which is generally the responsibility of the server provider.
(6) Administrators administrator's task is to manage database understanding, name service and transaction service and performance monitoring.
Idlscript
IDLScript is an integral part of the CORBA 3.0 specification, which takes full advantage of dynamic mechanisms. It is simple to learn, Corbascript is the first implementation of IDLScript, used as implements and operates CORBA objects.
Business EJB components
The business component is a "black box" without source code, and the text is given a detailed product information as the basis for customer evaluation. Typical textbooks include:
(1) Technical Wen
Online gear; common format is HTML, Help file, and PDF files.
Demonstration software; demo software can prove the value of the component, which is conducive to understanding the functionality and performance of component-based products, as well as training users, test components operating environment.
Evaluation trial; users are often skeptical about non-developing components, and the assessment of components is necessary, and a trial period is a good evaluation method.
Code samples; code samples are useful to establish prototypes and evaluate components for users, allowing users to understand how to make methods of operation.
Readme file; including final changes, errata, system environment requirements, component file definitions, installation considerations, and distribution information, etc.