"MS SQL Server 2000 Administrator Manual" series - 2. Microsoft Windows 2000 platform

  2. Microsoft Windows 2000 platform 
  Windows 2000 family 
  Windows 2000 components and functions of this chapter summary 
  Microsoft in February 2000 formally launched Windows 2000 operating system platforms.    Although the original Microsoft Window NT4 support of SQL Sever 2000, but Windows 2000 for SQL Sever2000 provide a more complete interface to SQL Sever 2000 in a more stable operation, a simple, safe operating platform.    In fact, the entire SQL Sever 2000 is in the Windows 2000 operating environment in the development of people. 
  Windows 2000 family 
  Windows 2000 have been offered in four versions: Windows 2000 Professional, Windows 2000 Server, Windows 2000 Advanced Server and Windows 2000 Datacenter Server.    This chapter we will introduce four simple version. 
________________________________________
  Relevant information you can go to Microsoft's Web site http://www.microsoft.com/windows2000 find more information about Windows 2000. 
________________________________________
  Windows 2000 Professional 

  Windows 2000 Professional and Windows 98 with the advantages of Windows NT4 to provide desktop and notebook computers a new operating system.    It combines the powerful Windows 98 management capabilities, built-in plug, and identification functions and is Windows NT 4's stability and security.    Windows 2000 strengthened the desktop and notebook computer capabilities, and reasonable prices. 
  Windows 2000 Server 

  Windows 2000 Server, Windows NT 4 followed Server product line.    Many Windows 2000 Server integration such as Web access, application support, networking, telecommunications and some infrastructure services, but also to provide a framework to benchmark to file and print sharing.    Windows 2000 with particular emphasis on its Active Directory.    Active Directory can help manage different types and decentralized network.    Discussed later in this chapter will continue to Active Directory. 
  Windows 2000 Advanced Server 

  Windows 2000 Advanced Server in the Windows 2000 servers maintain all of the features, it also has a special function to support applications such as network load balancing, clustering, and strong support symmetric multi-processing (symmetric multiprocessing). 
  Windows 2000 Datacenter Server 

  Windows 2000 Datacenter Server Windows 2000 server in a series of special use professional products.    It is to provide customers an integrated hardware and software products designed to meet the needs.    Datacenter Server mining selling strategic alliances, that is to say customers should be accompanied by supporting the purchase of hardware.    These companies provide software packages must be authorized by Microsoft vendors, supporting Microsoft software will be subject to strict testing and certification, the certification will be until after the passage of hardware and Datacenter Server integrate.    Certification is not only a single hardware certification, but at the Datacenter Server and its accompanying software to the overall certification.    The entire system from a new technical support team responsible for the support of the members of this group by Microsoft and hardware vendors engineers, providing technical support of a single window.    This group is the name of Microsoft Certified Support Center (MCSC), Datacenter Server provides users the following services: 
  • 99.9% more than the best time of the system implementation 
  • installation and configuration services 
  • system performance assessment 
  • round-the-clock technical support 
  • Site Service 
  Datacenter Server support 32 processors and 64 GB physical memory, is the need for high performance and scalability of enterprise data center design.    Datacenter Server can be extended to a variety of applications, ranging from simple to complex data warehousing engineering simulation can support. 
  Windows 2000 Series Version Comparison Table The table below four versions of Windows 2000 is the comparison table: 
  Table 2-1 series Windows 2000 

  Windows 2000 Professional Windows 2000 Server Server Windows 2000 Advanced Windows 2000 Datacenter Server functions of the client operating system suitable for business use desktop or notebook computer operating system to provide servo-file management, printer management, enterprise internal network and regional network Road services servo-operating system support and e-commerce applications Servo Servo System operating system for large-business product line servo-operating system, and task-oriented applications can be supported to provide support for 24832 CPU can support memory capacity 4 GB4 GB8 GB64 GB cluster two nodes with no errors transfer network load balancing cluster 32 nodes four cluster nodes wrong transfer network load balancing 32 bus system basic needs 133 - MHz, Pentium compatible CPU 64 MB RAM 1 GB hard disk space 133 - MHz, Pentium compatible CPU; 256 MB RAM, 1 GB hard disk space 133 - MHz, Pentium compatible CPU; 256 MB RAM, 1 GB hard disk space 133 - MHz, Pentium compatible CPU ; 256 MB RAM, 1 GB hard disk space 

  Windows 2000 components and functional stability 
  Window 2000 increased number of new features to stabilize the system, the following is a major few: 
  • Windows File Protection: This function can be avoided Windows 2000 system files by users or applications accidentally deleted, the changes.    When a new file system was installed, Windows will automatically identify the source and file versions. 

  • Driver signed certification: Windows 2000 Series drivers and system files and procedures have signed certification, certified by the driver of the original can be identified, have not been damaged or altered. 

  • Microsoft Installer: This function and Windows Installer Services work together to help users install, configure the environment, tracking, updating and removing the right software.    This feature provides an intuitive use interface, users can easily install or remove different applications.    In addition to providing a simple interface, Microsoft Installer can also repair damaged software applications, and can view a variety of components - such as log files and external resources - all components of the revised monitoring operations.    If a user accidentally delete an important application of the components, Microsoft Installer users in the next boot automatic recovery of the component files.    It should be noted that this feature only to be deleted files are Windows 2000 signed (Certified for Windows 2000) application, or if you have installed Microsoft Installer through the application software. 

  • Core model Write Protect: This function will be applications and operating systems for the core segment to ensure that the procedures will not be the core driver other adverse result of interference by Windows NT 4 the system. 

  • Reduce reboot requirements: in a previous version of Windows you add or delete driver or application procedures, will require a reboot.    Now in Windows 2000, you will find a lot to reduce the requirements reboot - after the installation of the software now almost no longer require re-booting. 

  • Microsoft Internet Information Server (IIS) application protection: This feature is the Web applications and Web server separates code, in order to avoid application led to a Web server to crash.    However, this feature is the Windows 2000 Server, Advanced Server and the only Datacenter Server, Windows 2000 Professional is not the function. 

  • Windows 2000 identifier plan: design a set of Microsoft Windows 2000 standard application identifier.    That is when you buy applications on the identification, the product is the standard has been adopted by Microsoft, the product certification applies to Windows 2000.    Certification standards by Microsoft and other non-Microsoft work out the professionals. 

  Computer security is the use of different security environment protection on demand.    Windows 2000 can be customized to provide the security settings, in order to ensure your computer and network security.    Following is the protection of several functions: 
  • Windows NT File System (NTFS) Windows NT file system is a security mechanism for the Windows 2000 core.    NTFS provides a single user or group of the file system protection. 

  • Windows NT security model has this function only allows authorized users to access the system resources.    This model can control which users can access objects (such as files and printers), the user can also control the use of object permissions.    In addition, you can activate the review and follow-up actions, and these actions are in breach of system security requirements. 

  • encrypted file system (EFS) This function allows you to encrypt files, but must be NTFS disk format.    Randomly generated password, encryption and decryption of all the steps very simple, users should be clearly understood. 

  • Support IPSec (IP Security, IP security) to protect the transmission of data on the network.    This function is to ensure that non-openness virtual network security an important function, because it enables data to the safety of transmission on the Internet.    Figure 2-1 for the security of IP settings dialog box. 



  Figure 2-1 "IP security" dialog box 
  • Kerberos support this function for Windows 2000 to provide a single sign of industry standards, high-security identification.    Kerbero is a standard Internet protocol, when you want to Windows 2000 operating system and other systems (such as UNIX) integration, Kerbero agreement very useful. 

  Simplicity of the simplicity of Windows 2000 is one of the important characteristics.    Windows 2000 operating system by adding many new features to streamline operations, or to Windows 2000 this large and complex procedures necessary to operate, the following are a few can simplify the process of operating functions: 
  • plug, and this feature simplifies installation in your other equipment necessary hardware configuration.    There are more than 12,000 kinds of equipment support plug, and specifications. 

  • Support for multi-language Windows 2000 offers users a complete language option. 

  • peer-to-peer support for Windows 2000 and older versions of Windows can share resources, such as sharing files, and the list of other peripheral equipment, which is old and the new can do point-to-point operation. 

  • Personal menu of Windows 2000 will be the beginning of significant personal options.    You used the application will appear at the beginning of options, and other applications with less is not real-time show. 

  • wizard and troubleshooting these before you see is no different from other Wizard, which can help you set up systems, system optimization, and help you identify the problems. 

  • Windows multimedia preview of this feature allows you to actually open before these multimedia files, you can use Windows Explorer to look at snapshots sets (snapshot). 

  • More and improved Wizard function when you in the system for routine and challenges of the work, the wizard provides step-by-step approach to the implementation of each of your steps.    Figure 2-2 in the Windows Wizard is used to help you step backup and restore jobs. 

  • IntelliMirror IntelliMirror enhanced user access to information and software work.    The technology of the mobile users (mobile users) provides a great convenience, because there was no point from which they boarded networks, intelligent mirror function of the computer resources allow them to "follow" them.    For example, Offline Files (Offline Folders) application is one of the benefits of IntelliMirror.    Such data folders allow users even in the face of failure of the state of online could still be sustained in the work of key documents.    To note is that the data must folder on the Windows 2000 Server is the server can be implemented this function. 



  Figure 2-2 Windows 2000 Backup and Restore Wizard 
  • Support for Universal Serial Bus (USB) Windows 2000 pair of USB component provides complete support.    In other words, you can be in your system connects to the USB device without configure or re-boot. 

  • graphical user interface (GUI) Windows 2000 user interface is based on Windows 98.    This interface allows users to the consistency and intuitive way to operate complex systems.    Figure 2-3 that is the GUI of Windows 2000. 

  • Use a network printer using Windows 2000, through the network any user can simply use the printer resources.    When a printer were issued (Published) to Active Directory, users can be based on their location or function (print color, speed and style) to search.    See Figure 2-4 in the new printer is the Wizard dialog box. 



  Figure 2-4 "Add Printer Wizard" dialog systems management and deployment 
  Windows 2000 Series offers many could enhance the management and deployment of the function.    These features not only help large organizations operating system for the deployment of the management and deployment of the future, there are many help. 
  • System Preparation Tool This tool for system administrators can simply copy the computer's configuration, system configuration and application.    SysPrep on Windows 2000 provides simple, rapid and effective deployment. 

  • Setup Manager when the system design and test system administrators to deploy the installation script, this graphical wizard in the course of these guidelines managers complete the work. 

  • Remote install the operating system tools that let system administrators can establish a standard desktop environment, and through the rapid deployment of the network. 

  • Microsoft Management Console (MMC) MMC console is designed to allow Microsoft or third-party system management tools provided by the consistency of the show can work environment.    Figure 2-5 MMC management of the environment is an example. 



  Figure 2-5 Microsoft Management Console Environment 
  • Windows Management Instrumentation (WMI) for system resources monitoring and management, WMI provides a standard framework.    In this way, third parties can develop consistent application procedures for the monitoring and control system. 

  • Group Policy Editor Group Policy Editor allows users managers for the computer environment defined rules.    These principles cover the security of user privileges, desktop settings and applications.    Figure 2-6 is seen in the Group Policy Editor. 



  Figure 2-6 Group Policy Editor window 
  • Internet Explorer Administration Kit (IEAK) IEAK let system administrators can rapidly deploy cross-platform specific versions of the Microsoft Internet Explorer 5.01.    Administrators can install only the components they need and application procedures. 

  • Microsoft distributed file system (Dfs) Dfs allows system managers for multiple network file servers and their resources, establishment of a single, class of Table View.    Dfs users can easily find services and resources.    On the other hand, Dfs scattered across multiple servers to maintain backup files can also enhance the effectiveness of the use of resources. 

  • disk quota system administrator can be tailored to each user and each disk, disk space can be developed using the line.    Figure 2-7 that is a local disk quota attribute table. 



  Figure 2-7 attributes of a local disk quota screens 
  • This class of storage management functions can be made less use of the recent data stored automatically to a cheaper storage media.    This allows those most frequently accessed data and applications can be effective use of expensive, high-speed storage medium. 

  • Dynamic Sector storage administrators to manage Windows 2000 allows administrators to increase sector, extending the sector, changes or repair disk mirroring RAID 5 disk array ─ even if the server is on-line processing services requested, it will not affect end-use. 

  • Automatic reboot services (such as IIS) can be set to "at the wrong time of the incident automatic reboot," which can shorten the time to pause system, but also reduce the number of management of the trouble. 

  • Kill process tree If the system administrators found a problem application, he (she) can be simple to deal with these and related processing sequence together in order to remove the need for replacement systems. 

  • Windows 2000 server configuration wizard you when you set up your server systems, the Wizard can provide a complete interface.    Figure 2-8 which is the wizard screen. 

  • Active Directory components for the system administrator through the same interface to manage the Windows operating system platform for the client and server.    This chapter has more to say later. 

  • Management System managers can be appointed authority delegated to individual users or groups without having to set their systems management personnel. 

  • Remote management of the Terminal Services components to allow system managers to be on the server to implement phase two of remote management. 

  Action Experience 
  Windows 2000 Professional is to "help laptop computer users" and "encourage the use of laptop computers," designed on the basis of viewpoint.    Although Windows 2000 series of other members can also operate on a laptop computer, but they are not Windows 2000 Professional offers power management and off-line functions.    Windows 2000 Professional in the combination of these features, making it a mobile computer operating system in the forefront. 
  • sleep mode since this function can be set to your computer screen and in a certain period of time after the automatic shutdown of static.    When the system is switched off when the data will be deposited into your memory hard drive, and Peter resume all-state, with exactly the same as when you left. 

  • offline folders and files even if it does not connect to the Internet, you can generally like to work on-line.    This function allows you to those stored in the document on the network to establish mirror. 

  • You can browse offline entire website (including graphics) to download back, and so when you have time to visit them, and not the state has been maintained on-line. 

  • Synchronization lets you manage this function in the server and can be compared with the on-line update your data off-line and off-line file folders. 

  • Intelligent Power Management Windows 2000 Professsional so you can more accurately observed that the battery power state.    You can simply use the power settings options, let your battery is the best use of the computer without sacrificing performance.    Figure 2-9 namely Power Options dialog box. 

  • Hot Docking This function allows you to connect a laptop computer on the dock or removed from the dock, without changing your hardware configuration or reboot. 

  • support infrared data transmission (IrDA) This function allows you to use standard infrared transmission protocol, the two Windows 2000 operating platforms to secure, wireless way to share data. 

  • Support for digital devices of Windows 2000 Professional support removable storage devices, such as DVD and other use of the Device Bay peripherals. 



  Figure 2-9 "power management" dialog box performance operating system performance using Windows 2000 platform is the key basis.    In SQL Server and Windows 2000 operating systems has been done with a wide range of performance tests.    Windows 2000 contains a number of functions that we can see that its performance: 
  • faster overall efficiency of Windows 2000 most of the enhanced system performance.    Smaller and more efficient memory adequate standard for Windows 2000 Windows NT 4 faster than 25%. 

  • faster multi-tasking operating Windows 2000 is a purely 32-bit operating system architecture.    This architecture will enable your computer in the computing unit and the use of better management, so you can also perform more procedures and more work. 

  • memory and processor scalable Windows 2000 operating system family support to 64 GB of memory and 32 processors. 

  • cluster services in the Advanced Server and Windows 2000 Datacenter Server, the cluster service can link multiple operating systems in order to enhance efficiency and performance.    In the simplest version, cluster services can be set up so that two servers for the cluster, when a wrong which one can provide an automatic backup.    Clustering services can be configured extension (scale-out) mode that allows 32 running Windows 2000 Server connects to the server to provide a powerful computing capacity. 

  • Network Load Balancing Windows 2000 Advanced Server and Datacenter Server support network load balancing (NLB).    NLB can be distributed in the Windows 2000 server clustering, dynamic and decentralized from the average network service requirements.    Managers simply increase NLB-Configured server can be in accordance with the needs of the workload to increase system capacity.    Figure 2-10 NLB that is the organization chart.    In this example, there are four Windows 2000 Advanced Server is set to a common implementation of IIS5 and NLB virtual server groups.    When the request from the Internet service transmitted over, they will be assessed an average of four to this server, in pursuit of the best performance and utilization. 



  Figure 2-10 network load balancing architecture planning model 
  • Enhanced Active Server Pages (ASP) performance Windows 2000 Server, Avanced Server and Datacenter Server built-in IIS5, enhanced ASP handling process.    Through the system to the implementation of the ASP website, the transmission flow has been considerably improved, and for those dealing with scripting without the ASP has also increased fast path function. 

  • IIS CPU speed adjustment to the implementation of integrated Web services applications with other applications, network managers can set service or application CPU time consumption restrictions.    At the same time that can be implemented to ensure that all applications can be made when necessary processor computing time. 

  Internet access to the Internet to support Windows 2000 Series is another key component.    For the integration and the pursuit of high-performance, Internet technology has been designed into the core operating system components.    Windows 2000 Internet functions as follows: 
  • Built-in Internet Explorer 5.01 Windows 2000 Series all have built-in the latest version of IE 5.01 browser. 

  • Internet Information Services 5.0 for Windows 2000 Server, Advanced Server and Datacenter Server have built-in IIS 5.0.    The integrated components allows users to set up a simple Web site and management.    IIS 5.0 includes Internet Information Service administrator, in the graphical interface of the work environment to set up and manage one or more Web sites.    Figure 2-11 that is the use of IIS administrator interface. 

  • powerful development platform IE support most of the programming language, including Dynamic HTML, ASP, Java and XML. 

  • Auto Agents IE5.01 can automatically find and complete proxy server settings. 

  • Automatic browser can remember completed before visited the web site, and you just enter the words, the former will automatically complete the entire site. 

  • Web data folder this function also known as (Web Document Authoring and Versioning, WebDAV), which allows Web designers can simply use the "drag and drop" in the way IIS 5.0 Web pages on the issue. 

  • Internet printing support Windows 2000 allows system managers to share printer resources out through the Internet, so users can print documents via the URL. 

  Active Directory 

  Active Directory is a new Windows 2000 server functions, but also on Windows 2000 network data and resource management core components.    The next part of the Active Directory provides an overview of the technology. 
  Active Directory structure 
  Active Directory can be used to store network information on all entities, such as applications, files, printers, and personnel.    These networks, regardless of how different entities, Active Directory provides a consistent way to describe them.    You can imagine into the Active Directory is a major choice panel.    These four on the network dispersed resources, Active Directory management is the relevance of the centralized mechanism.    Active Directory includes management tools and security tools to protect the privacy and network integrity. 
  Active Directory management tools is also user tools.    Different on the network and the resources to carry out widespread access, Active Directory can provide users with the same mode of interaction.    Users no longer need to worry about how to determine the names of network resources and location.    In the Active Directory, resources can be released to the right to the use of these resources before the users.    This release is through the Add / Remove Wizard or new procedures remove the printer to complete the wizard. 
  Active Directory for the system administrator in the management of network resources can be done component consistency and control unit settings.    Active Directory simplifies the "How to describe large, and different network" of such management issues, strengthen the security of the whole system, and expansion of the network of communication between different software and hardware. 
  Active Directory window on the operating system platform for users account, the client systems, servers, applications and provides a single management centre.    It is also on the integration and organization of non-window system to provide assistance.    Active Directory allows organizations to extend security system approach to the Internet. 
  Active Directory class is essentially a tree structure, see Figure 2-2.    Object can be users, groups, systems, devices, applications or other network entities.    These encompass a collection of objects, it could be an organization (such as the departments) or related objects (such as printer resources on the network) of the total formation. 
  Active Directory can also manage these objects and the relationship between the set.    System managers in the network view is that an integrated whole, rather than see the resources put in one place, during which the relationship between the pendulum in another place. 



  Figure 2-12 Active Directory Structure 
  Active Directory structure of the object has its own properties, these attributes describe the characteristics of various objects.    Unless users or managers need to understand them, or who may change in the information is often hidden, in order to safeguard the security of property.    When you increase the target attribute description, you can also set access privileges for each attribute.    In addition, the targets can be set to allow access to the entire domain of the state. 
  In order to maintain system performance, efficiency and flexibility, the use of multiple Active Directory major server replication (multimaster replication).    Managers can copy an entire directory, and copy these in place anywhere on the network.    When a copy on the network has changed, these changes will be automatically overwritten on the network to all copies. 
  Why For Active Directory 

  We have to understand Active Directory can streamline management, consolidate security, and between different software to communicate more easily, and then let us have a look at these advantages More details: 
  Simplify the management of today's networks is often scattered in a wide range of areas, and all around the management of these differences of the networks has become a protracted waste at work.    Furthermore, when these become more wide-area network management function is often copied to different locations, resulting in a surplus and co-ordination problems.    Active Directory provides a single point of control, manage different kinds of network resources. 
  Active Directory also on the application of procedures and other software deployment has helped.    In the past, the technical staff must personally visit each user workstation, even if they need to use only a small part of the process function.    This process is slow and wasteful.    Later, the new tools can allow applications from a central server to be deployed, but the technology has not and the overall management of the network to an integrated work.    Now Active Directory allows system managers in the safety of the existing structure down deployment and management software, the system deployment and management work, a lot of really reduce the burden. 
  Active Directory also allows managers to manage some functions delegated to the appropriate user or an organization.    Such authorization procedure is safe, and also enable some advanced users in the departments to provide their IT technology, thus allowing IT staff to assume other responsibilities. 
  Consolidation of security security in the Active Directory service is a key component.    Active Directory user authentication and will concentrate on the implementation of a management role-based security model.    Active Directory users or organizations to a default (but not edit) security competence "of the role."    Managers can choose to strictly manage users and resources, or at the right time to open their.    Active Directory support of this security model some security communications protocols, such as communications protocols, Kerberos, X.509 authentication, and smart card technology.    Whether users from the local area network or remote dial-up on-line, security model can provide a consistent security control. 
  Extended communication interface when growing network, different set of network resources and the technology is also being developed with.    These technologies in the development and deployment must work together to get the most cost-effective.    Most of the current network environment includes both E-mail, applications, network devices, Internet / e-commerce and enterprise network firewall applications, and so on directories set.    Active Directory provides for the integration of the application's standard interface, as well as open-synchronous device settings, such positioning can be different indeed the difference between the target, the security of the Windows operating system components can be dynamically in a variety of non - the Windows operating system installation and application procedures established between the channels of communication. 
  This chapter summary of this chapter a brief introduction of the Windows 2000 operating system family.    Each member of the family - Windows 2000 Professional, Windows 2000 Server, Windows 2000 Advanced Server and Windows 2000 Datacenter Server-specific functions are provided to meet the needs of users.    Using Windows 2000, regardless of your notebook or computer is a high-performance, 32 processor enterprise data centers, can use the same operating environment.    According to the information provided by this chapter, you should be able to prepare your choice to be adequate to meet demand for SQL Server 2000 installation of the Windows 2000 platform.    In the next chapter, we must return to the discussion of SQL Server database administrator and find out some of the responsibilities. 

Java technology Capriccio

  CSDN hero before the opening of the General Assembly Capriccio 

  Early Spring March, although still in the Jiangnan earth Wu spring season, but the recovery of all things fresh feeling or rushing toward us. Thanks to the support of my friends to vote, I vote in CSDN the MVB obtained second place in the upcoming four month, I am honoured by the invitation to participate in its CSDN organizations will be a hero. this is the last year I adhere to a written Bo affirm and encourage. 

  Has been in development for many years, what have been engaged in for so many years, from the bottom to the development of distributed framework of common language, development methods, what are tried, found that the software industry will this fact. 

  So many years, the small and medium-sized developers, I gradually realized the three things: 

  1. Java is not a panacea we have java language is so looking forward, as a C + + than simplify cross-platform object-oriented language. Java seems to be unable to bear our expectations. First language, the syntax java But in the expansion, the expansion of the much faster than the code itself on the efficiency of optimized speed. 

  In the desktop development areas, it seems unable to break through the Java VB, PB, DELPHI siege, in the field of Web, PHP, Ruby and other languages, and other fields is also hosting a big start on java encirclement. However, it seems that we still see Java as a natural the kingly way, perhaps because the garbage collection mechanism with the large number of free virtual machine and the components of the framework of it, this era, particularly in the no M $ software company eyes, not Java development system also embarrassed to open a few million. 

  But for the vast majority of service-oriented and the Quick Response portal development team, PHP Jiaoyao the posture it is too much of the charm. 

  Java stick to a course of the middleware straw.    But it seems that in the news-oriented and the framework of the ESB, the EJB can hardly stand up. 

  2. Revenue is not a panacea from the 2002 development of open-source software surging. Sf.net inside tens of thousands of open-source projects. Finishing what if open source MVC framework, to find more than 100, it is common the.    We take great enthusiasm to observe every open-source software. Found that open-source software like other people's meals, not always with your appetite.    Ebb Tide, dwr struts2 + + + hibernate this spring the framework of the final victory.    (Although only struts2 GA, but also more mature, because webwork2 themselves are very mature, struts2 is webwork2 a repurchase basically package name is changed) 

  3. JCP is not a panacea 
  JCP as a standard-setting organization, it seems that there has never been worked out what people are really practical things. Portlet from the JCR to JDO, it seems that there is no genuine together. 

  Portlet standards the biggest problem is that no definition of better interaction model, JCR problem is not SQL interface for the powerful.    JDO, the JPA category, it seems that also do not see any real alternative to Hibernate place. 

  For so many years the concept of real speculations: 

MVC
  Struts MVC successful, and he has simply become a synonym for, as a URL can be called a clear framework Judging from the current situation is far beyond the tapestry, jsf these frameworks.    When he found webwork than he achieved more easily after the operation, simply to ww2 with their combined. 

ORM
  Engage in java, you do not build the field model that is not face, the area had been built on the model of an inevitable need for a tool to fill him in the field Hibernate is the most accomplished fine 

IOC
  This concept is purely brought to Martin, even on really fire up.    The Masters had to admire. 

  IoC premise is any hope loaded components must survive in the container.    Struts2 results of the action of the spring has become the bean. 

AOP
  And IOC, the AOP SpringFramework successful, the use of a large number of spring can be streamlined code 

AJAX
  With the vigorous promotion of google, ajax is Hongtoushan half. 

  Speculation over the past few years not to the concept of: 

  Portal A few years ago, everyone mentioned portal, the gateway personal portal, personalized custom. 

  IT also take this concept of speculation Portal In China, however, we found that the vast majority of portal actually is a content management system or a simple Web site said, personalized custom seems to be no use, as most is the same google desktop subscribers with ajax Some news, coupled with the lack of proper Portlet standards, making Portal difficult to obtain greater development. 

  Workflow 

  Can not say that the work flow unsuccessful, a form engine with custom form circulation engine can indeed solve many business applications, but for so many years, does not have a workflow engine can be made as hibernate, in the spring these frameworks in the field of their own receive half results.    — Was written too fast, not weighing the urgency to the original, changed the sentence to avoid ambiguity:) 

  I shallow experience, I have seen many government units are on the OA, but the real number is not used up 

  The type of document flow: The great majority of units is the same as e-mail articles 

  The absence of written: small enterprises with poor management, promotion can not be large enterprises, SAP, and can have up 

  For more complex applications: Because of the requirements of the form data is relatively high, developers are usually developed a simple project for the transfer of engine, or the entire application based on the realization of the database. 

  The current popularity of the open-source work abroad flow jbpm, shark, and so only applies to the environment. 

  As a matter of fact called the "work flow", it is obvious that the work of the complex are vastly different, how can we expect a universal framework of the work flow?    If you design a call center for the use of the work flow, document-oriented sign of the work flow, and the work flow of documents issued perhaps also more likely to be effective. 

  Application of immature rules engine, which could really popular. 

  Is currently speculation, the concept of the future is uncertain 

ESB
  ESB is the use of the environment in a lot of off-the-shelf applications, and they provide an integrated interface, and this time if we develop new applications, you can use the ESB to simplify integrated operation.    But so far this premise environmental conditions in China also seems to have not been formed.    Therefore ESB whether the fire are still unknown. 

Java.util

  Linear List, linked list, hash table is a common data structure, these categories are in java.util package.    Collection Interface ├ List │ ├ LinkedList │ ├ ArrayList │ â”” Vector │ â”” Stack â”” Set Map Interface ├ Hashtable public class Hashtable extends Dictionary implements Map, Cloneable, java.io.Serializable ├ HashMap public class HashMap extends AbstractMap implements Map, Cloneable , Serializable â”” WeakHashMap Collection Interface Collection is a collection of the most basic interface, a representative of a group of Object Collection, Collection of elements (Elements).    Collection allow the same number of elements and some not.    Some sort while others can not.    Java SDK does not provide direct inherited from the Collection of categories, the category Java SDK are inherited from the Collection "of interface" such as List and Set.    Collection interface to achieve all categories must be provided two of the constructor function: the structure function parameters used to create an empty Collection, a Collection of the constructor function for the creation of a new Collection, and this new Collection Collection into the same element.    After a constructor function allows users to copy a Collection.    Traversing the Collection of how each element?    Collection regardless of how the actual type, which support an iterator () method, the method returns an iterative son can use the visits to each iteration of every element in the Collection.    Typical usage as follows: Iterator it collection.iterator = () / / iteration of a while (it.hasNext ()) (Object obj = it.next (); / /) be the next element from the Collection Interface Two interface is derived and Set List.    List List interface is orderly Collection, use this interface to precisely control the location of each element insertion.    Users can use index (List elements in the position, similar to the array subscript) to visit the List elements, similar to the Java array.    Below and to be mentioned Set different List allows the same elements.    In addition to the necessary interface Collection iterator () methods, also provide a listIterator List () method returns a ListIterator interfaces, and standards Iterator interface compared ListIterator with some add () method such as, Allow add, delete, set elements, but also traversing forward or backward.    List realization of a common interface LinkedList, ArrayList, Vector and Stack.    LinkedList class LinkedList realized List interface allows null elements.    In addition to provide additional get LinkedList, remove and insert method in the first LinkedList or tail.    LinkedList these operations could be used to stack (stack), the cohort (queue) or two-way Queuing (deque).    LinkedList no attention to the synchronization method.    If multiple threads at the same time visit a List, it must achieve their visit synchronization.    A solution is to create a structure List, synchronized List: List list = Collections.synchronizedList (new LinkedList (…)); ArrayList type ArrayList realized the size of the array variable.    It allows all the elements, including null.    ArrayList not synchronous.    Size, isEmpty, get, set method for run-time constants.    But add methods for the apportionment of costs constant, add n elements need to O (n) time.    Other methods running time is linear.    Each case has a capacity ArrayList (Capacity), which is used to store the size of the array elements.    With this capacity can be continually adding new elements to increase automatically, but there is no definition of growth algorithm.    When large number of elements need to insert, the insert can be called before ensureCapacity ArrayList method to increase the capacity to improve the efficiency of insertion.    And LinkedList, ArrayList is non-synchronous (unsynchronized).    Vector Vector type ArrayList very similar, but Vector is synchronized.    Vector created by the Iterator, although ArrayList created Iterator interface is the same, but because Vector is synchronized when a Iterator been created and is being used by another thread Vector change the status (for example, add or delete some element), then called Iterator methods will be dished out ConcurrentModificationException, it is necessary to capture the anomaly.    Stack of Stack inherited from Vector, the first to achieve a backward the stack.    Stack provide five additional approach allows Vector to be used as a stack.    Basic push and pop, there are peek method Zhanding elements empty method to test whether the stack is empty, search detected an element in the stack in place.    Stack just after the creation of the stack is empty.    Set Set is a kind of interface does not include the element of duplication Collection, two elements that arbitrary e1 and e2 have e1.equals (e2) = false, Set up to a null elements.    Obviously, the constructor function Set a restrictive conditions, imported Collection parameters can not contain repeated elements.    Please note: be careful operation variable object (Mutable Object).    If a variable element Set in the state has changed its lead Object.equals (Object) = true will lead to some problems.    Map Interface Please note that no successor Map Collection interface, Map provide the key to value mapping.    1 Map can not contain the same key, and each key can map a value.    Map interface provides three kinds of pools view, the contents of Map can be set as a key group, a group of value set, or a set of key-value mapping.    Hashtable class Hashtable succession Map interface, the realization of a key-value mapping of the hash table.    Any non-air (non-null) can be the target of a key or value.    Add the use of data put (key, value), get out the use of data (key), the two basic operating expenses for the time constants.    Hashtable through initial capacity and the load factor of two performance parameter adjustment.    Usually the default load factor 0.75 better achieved the balance of time and space.    Increased load factor can save space but find the corresponding time will increase, which will affect as get and put this operation.    Hashtable using the following simple example, 1,2,3 put Hashtable, they are the key "one," "two" and "three": Hashtable numbers = new Hashtable (); numbers.put ( "one" , new Integer (1)); numbers.put ( "two", new Integer (2)); numbers.put ( "three" new Integer (3)); To remove a few, such as 2, with the corresponding key : Integer n = (Integer) numbers.get ( "two"); System.out.println ( "two =" + n); as a key target will be calculated to determine the hash function with the corresponding value position, as key to any object, and the need to achieve hashCode equals method.    HashCode and equals method inherited from the root Object, if you use the definition of the category as key words, it is necessary to very carefully, in accordance with the definition of the hash function, if the two the same target group, that is, obj1.equals (obj2) = true, their hashCode must be the same, but if two different groups, they are not necessarily the hashCode different if two different hashCode the same object, a phenomenon known as conflict, post-conflict operation hash table will lead to spending time increased, Therefore, as defined hashCode () method, can speed up the operation of hash table.    If the same objects have different hashCode, the operation of the hash table will unexpected results (looking forward to the get method returns null), it is necessary to avoid such a problem, one need only remember: at the same time replication methods and hashCode equals, and not only wrote one of them.    Hashtable is synchronized.    HashMap category HashMap and Hashtable similar difference is HashMap non-synchronized, and allow null, null value and null key.    , But will be considered Collection at the HashMap (values () method can be returned to the Collection), the iteration of its operating expenses and HashMap time proportional to the capacity.    Therefore, if the performance of iterative important operation, will not HashMap initialization for the high capacity, or low load factor.    WeakHashMap WeakHashMap is an improvement of the HashMap, its key implementation of "weak quote," if a key no longer be quoted by the external, then the key can be recovered GC.    Summed up the case to the stacks, queues, and other operations, it should be considered List, the need to quickly insert, delete elements LinkedList should be used, if necessary element of fast random access, should use ArrayList.    If the program in the single-threaded environment, or visit only one thread, consider such non-synchronized, high efficiency, if multiple threads may also operate a class, the class should be used simultaneously.    To pay special attention to the operation of the hash table, as a key to the object of equals and hashCode correct replication methods.    As far as possible instead of the actual return to the type of interface, such as the return List rather than ArrayList so if the need arises will be replaced ArrayList LinkedList, client code need not change.    This is the abstract programming. 

Url ReWriting Example

  This provided by the Microsoft compiler components has been well and does not need to write their own code directly on the line:) 

  For Web.Config set to: 

  <configuration> Festival in the beginning with: 

<configSections>
  <section Name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" /> 
  </ ConfigSections> 

  In <configuration> section, add the following: 

<RewriterConfig>
<Rules>
<RewriterRule>
  <LookFor> ~ / News, (d (4)), (d (1,2)), (d (1,2)), (d (1,9)). Aspx </ LookFor> 
  <SendTo> ~ / News_view.aspx? Newsid = $ 4 </ SendTo> 
  </ RewriterRule> 
<RewriterRule>
  <LookFor> ~ / (D (4)) / (d (2)) / Default.aspx </ LookFor> 
  <SendTo> <! [CDATA [~ / news_view.aspx? Year & month = $ 1 = $ 2 ]]></ SendTo> 
  </ RewriterRule> 
  </ Rules> 
  </ RewriterConfig> 


  In addition <system.web> section: 

<httpModules>
  <add Type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" /> 
  </ HttpModules> 

  Dealing with the link: 

  News.aspx 

  Private void Page_Load (object sender, System.EventArgs e) 
  ( 
  / / User code placed here to initialize pages 
  DataTable dt = new DataProvider (). GetNewsToIndexPage (1); 
  / / URL Format 
  UrlFormat formats = new UrlFormat (); 

  LbNews.Text = "<ul>"; 
  If (dt.Rows.Count> 0) 
  ( 
  Int counter = 0; 
  While (counter <dt.Rows.Count) 
  ( 
  LbNews.Text + = "<li> <a href =" "+ formats.NewsUrl ((DateTime) dt.Rows [counter] [" NewsPubTime "], Convert.ToInt32 (dt.Rows [counter] [" NewsID "] )) + "" target = "_blank"> "+ dt.Rows [counter] [" NewsTitle "]. ToString () +" </ a> </ li> "; 
  Counter + +; 
  ) 
  ) 
  Else 
  ( 
  LbNews.Text = "<li style="color:red"> temporary Monayong </ li>"; 
  ) 
  LbNews.Text + = "</ ul>"; 
  Dt.Clear (); 
  Dt.Dispose (); 

  ) 

  UrlFormat.cs 

  Public class UrlFormat 
  ( 

  Public UrlFormat () 
  ( 
  ) 

  Public virtual string NewsUrl (DateTime dt, int NewsID) 
  ( 
  Return GetUrl ( "News, (0), (1), (2)," NewsID + +. "Aspx" dt.Year, dt.Month, dt.Day); 
  ) 

  Protected virtual string GetUrl (string pattern, params object [] items) 
  ( 
  Return string.Format (pattern, and items); 
  ) 

  ) 



  Format: 
  News, 2004,8,13,123. Aspx 

  At: 
  News.aspx? Some parameter parameter = 

  Role: to hide the true Url, cool! 

  Related Dll File Download: http://bbs.mvpcn.net/PostAttachment.aspx?PostID=405 

Getting Started with Java Management Extensions (JMX): Developing Management and Monitoring Solutions 2005/01/09 01:44:07

  Getting Started with Java Management Extensions (JMX): Developing Management and Monitoring SolutionsBy    SolutionsBy Qusay H. Mahmoud, January 6, 2004 

  Contents 
  — Overview of JMX - JMX Tiered Architecture - JMX Implementations - JMX and J2SE 5.0 - The JMX Programming Model - JMX for Remote Management - JMX Related Specifications 

  The Java Management Extensions (JMX) API is a standard specification-developed through the Java Community Process (JCP) as JSR 3-for managing and monitoring applications and services. It defines a management architecture, design patterns, APIs, and services for building Web - based, distributed, dynamic, and modular solutions to manage Java-enabled resources. The JMX APIs make it possible to add manageability to Java-enabled equipment, from web phones to set-top boxes to network devices and servers. Using JMX technology to manage applications and services increases their value to vendors and clients by making applications easier to install, configure, and maintain. 

  This article provides a fast track technical tutorial to JMX. It discusses JMX and its tiered architecture, the JMX programming model, and code demonstrating how to use JMX to develop management applications. In addition, the article shows how to use a JMX-compliant management tool in the Java 2 Platform, Standard Edition 5.0 (J2SE 5.0), which has implemented version 1.2 of the JMX specification. 

  Overview of JMX 

  JMX is native to the Java programming language. As a result, it offers natural, efficient, and lightweight management extensions to Java-based functions. It consists of a set of specifications and development tools for managing Java environments and developing state-of-the - art management solutions for applications and services. It provides Java developers with the means to instrument Java code, create smart Java agents, implement distributed management middleware and managers, and easily integrate these solutions into existing management and monitoring systems. The dynamics of JMX enable you to use it to monitor and manage resources as they are implemented and installed. It can also be used to monitor and manage the Java Virtual Machine (JVM machine). 

  Typical uses of the JMX technology include: 

  •   Consulting and changing application configuration 
  •   Collecting statistics about application behavior and making the statistics available 
  •   Notification of state changes and erroneous conditions 

  Benefits of JMX 

  The JMX technology enables Java developers to encapsulate resources as Java objects and expose them as management resources in a distributed environment. The JMX specification lists the following benefits to using JMX to build a management infrastructure: 

  •   Manages Java applications and services without heavy investment: JMX architecture relies on a core managed object server that acts as a management agent and can run on most Java-enabled devices. Java applications can be managed with little impact on their design. 

  •   Provides a scalable management architecture: A JMX agent service is independent and can be plugged into the management agent. The component-based approach enables JMX solutions to scale from small footprint devices to large telecommunications switches. 

  •   Can leverage future management concepts: It can implement flexible and dynamic management solutions. It can leverage emerging technologies; for example JMX solutions can use lookup and discovery services such as Jini network technology, UPnP, and Service Location Protocol (SLP). 

  •   Focuses on management: While JMX provides a number of services designed to fit into a distributed environment, and its APIs are focused on providing functionality for managing networks, systems, applications, and services. 


  JMX provides a tiered architecture where managed resources and management applications can be integrated in the plug-and-play approach as shown in Figure 1. A given resource is instrumented by one or more Java objects known as Managed Beans (or MBeans), which are registered in a core managed object server known as the MBean server. This server acts as a management agent and can run on most Java-enabled devices. 

Figure 1: JMX Tiered Architecture
  Figure 1: JMX Tiered Architecture 


  As Figure 1 demonstrates, there are three tiers or levels in this architecture: instrumentation, agent, and manager. 

  Instrumentation Level 

  This tier contains MBeans and their manageable resources. It provides a specification for implementing JMX-manageable resources, which can be an application, service, device, or user. A resource is manageable if it is developed in Java (or provides a Java wrapper) and has been instrumented so that it can be managed by JMX-compliant applications. A resource is instrumented by one or more MBeans that are either standard or dynamic. Standard MBeans are Java objects that conform to certain design patterns (for example, they must have a constructor and setter / getter methods). A dynamic MBean conforms to a specific interface that offers more flexibility at runtime. The instrumentation of a resource allows it to be manageable at the agent level; however, note that MBeans do not require knowledge of the JMX agent with which they operate. In other words, any JMX-manageable resource can use any JMX agent that offers the services it requires. 

  The key Components at the instrumentation level are the MBeans, the notification model, and the MBean metadata classes. 

  •   MBeans: An MBean is a Java object that implements a specific interface. The management interface of an MBean is represented as: (1) valued attributes that can be accessed; (2) operations that can be invoked; (3) notifications that can be emitted; and (4) the constructors. There are four types of MBeans: 

    1.   Standard MBeans: The simplest to design and implement. Their management interface is described by their method names. 
    2.   Dynamic MBeans: They implement a specific interface, and they expose their management interfaces at runtime for greatest flexibility. 
    3.   Open MBean: Dynamic MBeans that rely on basic data types for universal manageability; they are self-describing for user-friendliness. 
    4.   Model MBeans: Dynamic MBeans that are fully configurable and self described at runtime. They provide a generic MBean class with default behavior for dynamic instrumentation of resources. 

  •   Notification Model: JMX defines a generic notification model based on the Java event model. It lets developers build proactive management solutions. Using notifications, JMX agents and MBeans can send critical information to interested parties such as management applications or other MBeans. 

  •   MBean Metadata Classes: These classes contain the structures to describe all components of an MBean's management interface: its attributes, operations, notification, and constructors. For each of these, the metadata include a name, a description and its particular characteristics (for example, an attribute is readable, writeable, or both; for an operation, the signature of its parameter and return types). 

  Agent Level 

  This tier contains the JMX agents used to expose the MBeans. It provides a specification for implementing agents, which control the resources and make them available to remote management applications. Agents are usually located on the same machine as the resources they manage, but this is not a requirement. The JMX agent consists of an MBean server and a set of services for handling MBeans. Managers access an agent's MBeans and use the provided services through a protocol adaptor or connector. But note that JMX agents do not require knowledge of the remote management applications that use them. 

  The main components at the agent level are the MBean Server and Agent Services. 

  •   MBean Server: A registry of objects that are exposed to management operations in an agent. Any object registered with the MBean server becomes visible to management applications. However, note that the MBean server only exposes an MBean's management interface and never its direct object reference. Any resources that you want to manage from outside the agent's JVM must be registered as an MBean in the server. The server also provides a standardized interface for accessing MBeans within the same JVM, giving local objects all the benefits of manipulating manageable resources. MBeans can be instantiated and registered by another MBean, and the agent itself, or a remote management application through the distributed services. 

      When you register an MBean, you must assign it a unique object name, which is used by the management application to identify the object on which to perform a management operation. 

  •   Agent Services: Objects that can perform management operations on the MBeans registered in the MBean server. By including management intelligence in the agent, JMX helps you build more powerful management solutions. JMX defines the following Agent Services available in J2SE 5.0: 

    •   Dynamic Class loader: Through the management applet (m-let) service, retrieves and instantiates new classes and native libraries from an arbitrary network location 
    •   Monitors: Observe the numerical or string value of an attribute of several MBeans and can notify other objects of several types of changes in the target. 
    •   Timers: Provide a scheduling mechanism based on a one-time alarm-clock notification or on a repeated, periodic notification. 
    •   The relation service: Defines associations between MBeans and enforces the cardinality of the relation based on predefined relation types. 

  Manager (or Distributed Services) Level 

  This tier contains the components that enable management applications to communicate with JMX agents. It provides the interfaces for implementing JMX managers, and defines the management interfaces and components that operate on agents. Such components provide an interface for a management application to interact with an agent and its JMX manageable resources through a connector, and also expose a management view of a JMX agent and its MBeans by mapping their semantic meaning into the constructs of a data-rich protocol (such as HTML). 

  JMX comprises a separate package for each tier of the management architecture. The instrumentation tier will be free, and other tiers can be built from public specifications or reference implementations available under Sun Community Source License. Alternatively, you can purchase commercially supported products. 

  JMX Implementations 

  The Java 2 Platform, Standard Edition 5.0 (J2SE 5.0) supports JMX 1.2 and JMX Remote API 1.0, which is now the official JMX reference implementation (RI). For developers who are running J2SE 1.4, a JMX RI is also available from Sun Microsystems , and can be downloaded free of charge. 

  Sun Microsystems also provides the Java Dynamic Management Kit (Java DMK). Java DMK 5.1 is the first commercial implementation of the latest versions of the JMX standards, JMX 1.2 and JMX Remote API 1.0. JMDK is an all-in-one product for building secure, interoperable monitoring and management solutions on the J2SE platform, and it is supported on Solaris, Microsoft Windows, and Linux. Several other commercial and open source implementations are available as well. It is worth noting that Tomcat 5.0 implements the JMX specification. 

  JMX and J2SE 5.0 

  J2SE 5.0 has implemented version 1.2 of the JMX specification and version 1.0 of the JMX Remote API (JSR 160) specification. J2SE 5.0 includes significant monitoring and management features, including: 

  •   JVM instrumentation: The JVM is instrumented for monitoring and management providing built-in, out-of-the-box management capabilities for local and remote access. 

  •   Monitoring and Management APIs: The java.lang.management package provides the interface for monitoring and managing the JVM. It provides access to information such as: number of classes loaded and threads running, memory consumption, garbage collection statistics, on-demand deadlock detection , and others. 

  •   Management tools such as JConsole, which is a JMX-compliant monitoring tool that comes with J2SE 5.0. It uses JMX instrumentation of the JVM to provide information on performance and resource consumption of applications running on the Java platform. 

  The core classes for the JMX implementation are provided in the javax.management package. In addition, the java.lang.management package provides the mangagement interface for monitoring and management of the JVM as well as the operating system on which the JVM is running. 

  To enable the JMX agent and configure its operation using jconsole, your must set some specific system properties when you start the JVM. For local access, and set the property com.sun.management.jmxremote as follows when starting the JVM: 

  Prompt> java-Dcom.sun.management.jmxremote AppName 

  And, to enable monitoring and management from remote systems, and set the property: 

  Com.sun.management.jmxremote.port = portNumber 

  For more information on setting system properties for JMX, please see Monitoring and Management using JMX. 

  The JMX Programming Model 

  Using JMX to instrument your applications, services, or devices for manageability is simple. This is because JMX shares Java's object model. If you are familiar with Java and its JavaBeans component model, you already know 95 percent of all you need to know. 

  As mentioned previously, an MBean is a Java object that follows some standard design patterns and naming conventions. It can represent a device, application, or any resource that needs to be managed. An MBean exposes a management interface or a set of readable and / or writable attributes and a set of invokable operations, along with a self-description. Note that the management interface does not change through the life of an MBean instance. 

  Sample Application 

  This simple application manages a resource. You will create a simple standard MBean that exposes a String object and an operation. For more JMX examples, please see the JMX Tutorial. 

  The first step is to develop the MBean interface. In this application, the interface is called HelloMBean, which declares three methods: one getter, one setter, and one for saying hello as shown in Code Sample 1. 

  Code Sample 1: HelloMBean.java 

  Public interface HelloMBean (public void setMessage (String message); public String getMessage (); public void sayHello ();) 

  The next step is to implement the MBean interface. A sample implementation is shown in the following Code Sample. 

  Code Sample 2: Hello.java 

  Public class Hello implements HelloMBean (private String message = null; public Hello () (message = "Hello there";) public Hello (String message) (this.message = message;) public void setMessage (String message) (this.message = message;) public String getMessage () (return message;) public void sayHello () (System.out.println (message);)) 

  Congratulations! You have created your first MBean. The next step is to test the MBean, by developing a JMX agent in which you register the MBean. A JMX agent is a component in the agent level and acts as a container for the MBean. A sample agent, SimpleAgent, is provided in Code Sample 3. This agent performs the following tasks: 

  1.   Gets the platform MBeanServer 
  2.   Registers an instance of the Hello MBean 
  Code Sample 3: SimpleAgent.java 

  Import javax.management .*; import java.lang.management .*; public class SimpleAgent (private MBeanServer mbs = null; public SimpleAgent () (/ / Get the platform MBeanServer mbs ManagementFactory.getPlatformMBeanServer = () / / Unique identification of MBeans Hello helloBean = new Hello (); ObjectName helloName = null; try (/ / Uniquely identify the MBeans and register them with the platform MBeanServer helloName = new ObjectName ( "SimpleAgent: name = hellothere"); mbs.registerMBean (helloBean, helloName );) catch (Exception e) (e.printStackTrace ();)) / / Utility method: so that the application continues to run private static void waitForEnterPressed () (try (System.out.println ( "Press    To continue …"); System.in.read ();) catch (Exception e) (e.printStackTrace ();)) public static void main (String argv []) (SimpleAgent agent = new SimpleAgent (); System.out.println ( "SimpleAgent is running …"); SimpleAgent.waitForEnterPressed ();)) 

  The java.lang.management.ManagementFactory class is a factory class for getting managed beans for the Java platform. In this example, the getPlatformMBeanServer () method is used to get the platform MBeanServer, which is the interface for MBean manipulation on the agent side . It contains the methods necessary for the creation, registration, and deletion of MBeans. The MBeanServer is the core component of the JMX infrastructure. 

  To experiment with this application, do the following: 

  1.   Create a directory of your choice (such as jmx-example) 
  2.   Copy Code Samples 1, 2, and 3 into that directory 
  3.   Compile all the. Java files using javac 
  4.   Run SimpleAgent. In order to use the jconsole tool to manage it, you should run the SimpleAgent as follows: 

      Prompt> java-Dcom.sun.management.jmxremote SimpleAgent 

      Note: The-Dcom.sun.management.jmxremote system property creates an RMI connector to the platform MBeanServer. For information on the RMI connector, see the coming section, Using the RMI Connector. 

  5.   Connect to the JMX agent using the jconsole tool. Run the jconsole tool from the command line. 

      Once you start jconsole, it will display the list of local processes to be monitored as shown in Figure 2. 

    Figure 2: The jconsole monitoring tool
      Figure 2: The jconsole monitoring tool 


  6.   Now, you can connect to the service. Once connected, select the MBeans tab so that you can list the MBeans and manage them as shown in Figure 3. 

    Figure 3: The MBeans tab of jconsole
      Figure 3: The MBeans tab of jconsole 

  It is worth noting that local monitoring with jconsole is useful for development and prototyping. It is not recommended that jconsole be used locally for production environments as it consumes significant system resources. Jconsole should be used on a remote system from the platform being monitored. For more information on jconsole and sample screenshots of what it provides, please see Using JConsole 

  JMX for Remote Management 

  The MBean server relies on protocol adaptors and connectors to make a JMX agent accessible from management applications outside the agent's JVM. Adaptors provide a view through a specific protocol for all MBeans registered in the MBean server (for example, an HTML adaptor could display an MBean in a Web browser). Connectors provide a manager-side interface that handles the communication between manager and JMX agent. When a remote management application uses this interface, it can connect to a JMX agent transparently through the network regardless of the protocol. 

  JMX technology exports JMX API instrumentation to remote applications by using Remote Method Invocation (RMI). It also defines an optional protocol based directly on TCP sockets called the JMX Messaging Protocol (JMXMP). However, note that this protocol is not supported in J2SE 5.0 . 

  The JMX Remote API 1.0 (JSR 160) specification describes how to advertise and find JMX agents using existing discovery and lookup infrastructures. In other words, the specification does not define its own discovery and lookup service. Using existing discovery and lookup services is optional; you can encode the address of your JMX API agents in the form of URLs and make these URLs available to the manager. 

  Using the RMI Connector 

  Code Sample 4 shows an example of using the RMI connector, which is a slight modification of Code Sample 3. 

  Code Sample 4: SimpleAgent.java 

  Import javax.management .*; import java.lang.management .*; import javax.management.remote .*; public class SimpleAgent (private MBeanServer mbs = null; public SimpleAgent () (/ / Get the platform MBeanServer mbs = ManagementFactory. getPlatformMBeanServer (); / / Unique identification of MBeans Hello helloBean = new Hello (); ObjectName helloName = null; try (/ / Uniquely identify the MBeans and register them with the MBeanServer helloName = new ObjectName ( "SimpleAgent: name = hellothere") ; mbs.registerMBean (helloBean, helloName) / / Create an RMI connector and start it JMXServiceURL url = new JMXServiceURL ( "service: jmx: rmi: / / / jndi / rmi: / / localhost: 9999/server"); JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer (url, null, mbs); cs.start ();) catch (Exception e) (e.printStackTrace ();)) public static void main (String argv []) (SimpleAgent agent = new SimpleAgent (); System.out.println ( "SimpleAgent is running …");)) 

  To run this application, do the following: 

  1.   If you wish to run this application on J2SE 1.4, you need to change the line mbs = ManagementFactory.getPlatformMBeanServer (); 
      MBeanServerFactory.createMBeanServer to mbs = ( "SimpleAgent"); 
  2.   Compile the revised SimpleAgent.java from Code Sample 4. 
  3.   Start the rmiregistry on port 9999 (prompt> rmiregistry 9999) 
  4.   Run SimpleAgent (prompt> java SimpleAgent) 
  5.   While SimpleAgent is running, run jconsole and then use the Advanced tab and enter the information as shown in the following figure. 

    Figure 4: Configuring jconsole for remote management
      Figure 4: Configuring jconsole for remote management 


  6.   Once you are connected, you can browse the MBeans and manage them using the MBeans tab as shown in Figure 5. 

    Figure 5: Browsing and managing remote MBeans
      Figure 5: Browsing and managing remote MBeans 

  Using the HTML Adaptor 

  An HTML adaptor is provided by Sun Microsystems and comes with the JMX Reference Implementation (it doesn't come with J2SE 5.0). The HTML adaptor lets you manage MBeans using a Web browser. The adaptor enables you to interact with the agent to view registered MBeans and their attributes. In other words, this adaptor provides a simple yet powerful management tool that lets you: 

  •   View the readable MBean attributes 
  •   Update writable attributes 
  •   Invoke methods 

  Code Sample 5 shows the revised SimpleAgent that uses the HTML adaptor. 

  Code Sample 5: SimpleAgent.java 

  Import javax.management .*; import java.lang.management .*; import com.sun.jdmk.comm.HtmlAdaptorServer; public class SimpleAgent (private MBeanServer mbs = null; public SimpleAgent () (/ / Create an MBeanServer and HTML adaptor (J2SE 1.4) = ManagementFactory.getPlatformMBeanServer mbs (); HtmlAdaptorServer adapter = new HtmlAdaptorServer (); / / Unique identification of MBeans Hello helloBean = new Hello (); ObjectName adapterName = null; ObjectName helloName = null; try (/ / Uniquely identify the MBeans and register them with the MBeanServer helloName = new ObjectName ( "SimpleAgent: name = hellothere"); mbs.registerMBean (helloBean, helloName); / / Register and start the HTML adaptor adapterName = new ObjectName ( "SimpleAgent: name = htmladapter , port = 8000 "); adapter.setPort (8000); mbs.registerMBean (adapter, adapterName); adapter.start ();) catch (Exception e) (e.printStackTrace ();)) public static void main (String argv []) (SimpleAgent agent = new SimpleAgent (); System.out.println ( "SimpleAgent is running …");)) 

  To experiment with this application, do the following: 

  1.   Download the JMX Reference Implementation. This is needed only because SimpleAgent (in Code Sample 5) uses the HTML Adaptor, which does not come with the J2SE 5.0 implementation of JMX 1.2. From the JMX implementation, you only need the jmxtools.jar file. 
  2.   If you wish to run this application on J2SE 1.4, you need to change the line mbs = ManagementFactory.getPlatformMBeanServer (); 
      MBeanServerFactory.createMBeanServer to mbs = ( "SimpleAgent"); 
  3.   Compile all the. Java files (Code Samples 1, 2, and 5) Make sure you include the jmxtools.jar in your classpath. 
  4.   Run SimpleAgent. Make sure you include the jmxtools.jar in your classpath. SimpleAgent will run as a server. 
  5.   Connect to the JMX agent by entering the URL http://localhost:8000 in your web browser. 

        Once connected to the JMX agent, the HTML adaptor provides three views: 

      •   Agent view: Provides a summary of the MBeans contained within the agent. You can filter the MBean list to provide refined views. 

        Figure 6: HTML adaptor agent view
          Figure 6: HTML adaptor agent view 


      •   MBean view: Provides details about a specific MBean. Here you can set and get MBean attributes and invoke methods as shown in Figure 7. 

        Figure 7: HTML adaptor MBean view
          Figure 7: HTML adaptor MBean view 


      •   Admin view: Allows you to register new MBeans on the agent as shown in Figure 8. 

        Figure 8: HTML admin view
          Figure 8: HTML admin view 


      JMX Related Specifications 

      The various JSRs that related to JMX follow: 

    •   JSR 3: JMX 1.2 
    •   JSR 77: J2EE Management 
    •   JSR 160: JMX Remote API 1.0 
    •   JSR 174: Monitoring and Management Specification for the JVM 
    •   JSR 255: JMX 2.0 
    •   JSR 262: Web Services Connector for JMX Agents 
      Summary 

      JMX provides a component-based architecture for developing solutions to monitor and manage your applications, services, and resources. JMX technology is the way to instrument any application or service that was built using Java technology. Hence, the Java platform now provides excellent facilities for creating and managing applications and services. JMX technology should be used for any application and service that benefit from being manageable, as this will increase their value to vendors and clients, by making them easier to install, configure, and maintain. The current version of JMX is 1.2, and the JMX 2.0 update was launched in September 2004. It will update the JMX and JMX Remote APIs to improve existing interfaces, mainly with respect to ease of use. 

      This article provided a fast track introduction and tutorial to JMX and its programming model. The sample code provided demonstrates how easy it is to get started developing management and monitoring solutions using JMX. The J2SE 5.0 implements the JMX specification-if you use J2SE 5.0, you are ready to start developing using JMX. 

      Related Information 
    •   Java Management Extensions (JMX) 
    •   Companies and products that use JMX technology 
    •   J2SE 5.0 JMX Tutorial 
    •   Monitoring and management in J2SE 5.0 
    •   J2SE 5.0 JMX Guide 
    •   JMX Reference Implementation 
    •   Sun's Java Dynamic Management Kit (Java DMK) 
    •   JMX Marketplace 
    •   Using JConsole to Monitor Java Applications 
      Acknowledgments 

      Special thanks to Mandy Chung and Eamonn McManus of Sun Microsystems, whose feedback helped me improve this article. 

    Dynamic Array Processing Method

      1. Introduction 
      In the actual development, we could deal with a real-time array (Array), the paper, I use memory copy to achieve dynamic arrays-related operations. 

      2. Related Acer 

      # If defined (_MSC_VER) 
      # Define VLCCVP (void **) 
      # Else 
      # Define VLCCVP 
      # Endif 

      # Define INSERT_ELEM (p_ar, i_oldsize, i_pos, elem) \ 
      Do \ 
      (\ 
      If (! I_oldsize) (p_ar) = NULL; \ 
      (P_ar) = VLCCVP realloc (p_ar, ((i_oldsize) +1) * sizeof (* (p_ar))); \ 
      If ((i_oldsize) - (i_pos)) \ 
      (\ 
      Memmove ((p_ar) + (i_pos) +1 (p_ar) + (i_pos), \ 
      ((I_oldsize) - (i_pos)) * sizeof (* (p_ar))); \ 
      ) \ 
      (P_ar) [i_pos] = elem; \ 
      (I_oldsize) + +; \ 
      ) While (0) 

      # Define REMOVE_ELEM (p_ar, i_oldsize, i_pos) \ 
      Do (\ 
      If ((i_oldsize) - (i_pos) -1) \ 
      (\ 
      Memmove ((p_ar) + (i_pos), (p_ar) + (i_pos) +1 \ 
      ((I_oldsize) - (i_pos) -1) * sizeof (* (p_ar))); \ 
      ) \ 
      If (i_oldsize> 1) \ 
      (\ 
      (P_ar) = realloc (p_ar, ((i_oldsize) -1) * sizeof (* (p_ar))); \ 
      ) \ 
      Else \ 
      (\ 
      Free (p_ar); \ 
      (P_ar) = NULL; \ 
      ) \ 
      (I_oldsize) -; \ 
      ) While (0) 




    Jsp solve problems in hash

      8859_1 database it is best to use the format, 
      Therefore, stored in the database and when to transcoding, but we usually display format for the GB2312 or GBK, so take the time out once again 

      For example: 

      When used in the database: 
      The data format conversion 8859_1 
      Name = new String (name.getBytes ( "gb2312"), "8859_1"); 
      Content = new String (content.getBytes ( "gb2312"), "8859_1"); 

      Insert into (name, content) values (?,?)……. 

      Take the time from the database using: 
      Connection con = DriverManager.getConnection ( "jdbc: mysql: / / localhost / gfqqqqpe? User & password = = gfqqqqpe_f aaaaa & useUnicode = true; characterEncoding = 8859_1"); 
      From the database from the time specified encoding "8859_1" 
      Then display the time for conversion: 
      Name = new String (name.getBytes ( "8859_1"), "gb2312"); 
      This approach, common in the MYSQL 

      / / Chinese-Defined Function 
    <%!
      Public String getStr (String str) 
      ( 
      Try 
      ( 
      String temp_p = str; 
      Byte [] = temp_p.getBytes temp_t ( "ISO8859-1"); 
      String temp = new String (temp_t); 
      Return temp; 
      ) 
      Catch (Exception e) 
      ( 
      E.printStackTrace (); 
      ) 
      Return "null"; 
      ) 
    %>

    Jxl.jar operation and the use of JAVA EXECL

      / / Procedures: jxl.jar to Classpath to import the. 

      Import jxl .*; 
      Import java.io. *; 
      Import jxl.write .*; 
      / ** 
      * <p> Java read Excel spreadsheet, copy intimate, update Excel worksheet thin </ p> 
      * / 
      (Public class Test1 
      Public static void main (String [] args) ( 
      Jxl.Workbook rwb = null; 
      Try ( 
      / / Construction Workbook objects CD-Workbook objects 
      / / Create documents directly from the local Workbook 
      / / Input streams to create Workbook 
      InputStream is = new FileInputStream ( "D: / / Book1.xls"); 
      Rwb = Workbook.getWorkbook (is); 
      / / Sheet (terminology: Working Table) is the lower left-hand corner of the Excel spreadsheet Sheet1, Sheet2, but in the proceedings Sheet3 
      / / Sheet from the subscript is the beginning of 0 
      / / Get the first table Sheet 
      Sheet rs = rwb.getSheet (0); 
      / / Get Sheet included in the table shown in the total number of 
      Int rsColumns = rs.getColumns (); 
      / / Get Sheet included in the table of the head office 
      Int rsRows = rs.getRows (); 
      / / Get that this cell under the object reference 
      For (int i = 0; i <rsRows; i + +) ( 
      For (int j = 0; j <rsColumns; j + +) ( 
      Cell cell = rs.getCell (j, i); 
      System.out.print (cell.getContents () + ""); 
      ) 
      System.out.println (); 
      ) 
      / / Use of Excel has created thin creation of a new work can be included in the Excel worksheet thin 
      Workbook.createWorkbook jxl.write.WritableWorkbook wwb = (new File ( "D: / / Book2.xls"), rwb); 
      / / Read the first work table 
      Jxl.write.WritableSheet ws = wwb.getSheet (0); 
      / / Get the first cell target 
      Ws.getWritableCell jxl.write.WritableCell wc = (0, 0); 
      / / Decisiveness cell types, corresponding to the conversion of 
      If (wc.getType () == CellType.LABEL) ( 
      Label l = (Label) wc; 
      L.setString ( "The value has been modified."); 
      ) 
      / / Write Excel Object 
      Wwb.write (); 
      Wwb.close (); 
      ) Catch (Exception e) ( 
      E.printStackTrace (); 
      ) 
      Finally ( 
      / / Operation is completed, the closure target, the use of translation memory space 
      Rwb.close (); 
      ) 
      ) 
      ) 

    LinkedList mail address storage use

      / * 

      In addition to centralized storage of user-defined categories, the following procedure on another important, it is noteworthy things very short. When considering using 50 lines of code to achieve the establishment of a storage, retrieval and processing of information addresses linked list , the ability to cluster framework becomes obvious. 

      * / 

      / / A simple mailing list example. 
      Import java.util .*; 
      Class Address ( 
      Private String name; 
      Private String street; 
      Private String city; 
      Private String state; 
      Private String code; 

      Address (String n, String str, String c, String sta, String cod) ( 
      Name = n; 
      Street = str; 
      City = c; 
      State = sta; 
      Code = cod; 
      ) 
      Public String toString () ( 
      Return name + "\ n" + street + "\ n" + 
      City + "" + state + "" + code; 
      ) 
      ) 
      (Public class MailList 
      Public static void main (String [] args) 
      ( 
      LinkedList ll = new LinkedList (); 
      / / Add elements to the linked list 
      Ll.add (new Address ( "ChenHuajiang", "11 Oka Ave", "Urbana", "IL" and "61801")); 
      Ll.add (new Address ( "ShengJiahui", "12 Oka Ave", "Urbana", "IL" and "6