Tuesday, October 26, 2010

OSGi Bundle of Hello World



This is "Hello, OSGi" series of the second part. OSGi has been introduced prior to what will continue on the following article describes the content, about a simple OSGi Bundle: Hello World are developed.

51CTO Editors: OSGi entry and practice of all captures

Develop a simple Hello World of OSGi Bundle (OSGi binding package)

In OSGi, the software is released in the form of Bundle. A Bundle from the Java classes and other resources of its Bundle for other services, you can also import other Bundle in Java packages; Meanwhile, OSGi's Bundle where the equipment can provide some of its features. Eclipse for the development of OSGiBundle provides excellent support, which not only provides a wizard to create the OSGi Bundle, and also provides embedded Equinox container, you can use the OSGi container implementation and debugging plug-ins. Please note that each Eclipse plug-in essence, is an OSGi Bundle, just add this OSGiBundle some Eclipse-specific code only. Let us look at how to use Eclipse to develop a simple OSGi the HelloWorld Bundle.

3.1. New Bundle

1) In Eclipse, click on "File-> New-> Project" menu, you will see a new project to create dialog boxes;

2) In the New Project dialog box, select the "Plug-inProject (plug-in project)" and click "Next (Next)" button, you will see the plug-in project dialog box;

3) In the plug-in project dialog box, type the following values:

Project Name (Project Name): com.javaworld.sample.HelloWorld

Target Platform (target platform): an OSGiFramework-> Standard (OSGi Framework -> standard)

4) the requirements of other input values using default values and click "Next (Next)" button, you will see the plug-in context of the dialog box;

5) In the plug-in the context of the dialog box, select the default values and click "Next (Next)" button;

6) In the Template dialog box, select the "Hello OSGiBundle (Hello, OSGi package)" template, then click "Finish (complete)" button to complete the project.

Eclipse will take a few seconds Clock Generation HelloWorld Bundle template code, it built two files: Activator.java and MANIFEST.MF, the following, let us look at these two files:

3.1.1. Activator.java file

Source List 1.Activator.java

package com.javaworld.sample.helloworld; importorg.osgi.framework.BundleActivator; importorg.osgi.framework.BundleContext; publicclass Activator implements BundleActivator (public void start (BundleContext context) throws Exception (System.out.println ("Helloworld" );) public void stop (BundleContext context) throws Exception (System.out.println ("GoodbyeWorld");))

If you want your Bundle developed in their own startup or shutdown notice, you should create a new class, make it happen BundleActivator interface, the same time, you also need to comply with the following rules:

This class implements BundleActivator interface must have a public, non-constructor with parameters, so, OSGi framework will call the class of Class.newInstance () method to create this BundleActivator object;

Activator class vessel will call start () method to start the Bundle, therefore, we can start () method to perform initialization of the operation some resources, for example, we can get in the way the database connection, for later use. The start () method the only parameter is a BundleObject object, Bundles can be the object and the OSGi framework for communication, we can get from the object information related to OSGi container; If a Bundle thrown, the container will be the home for the "stopped (stopped)" status, this time, this Bundle can not provide services outside.

If we are to close a Bundle, the container will call the Activator class in the stop () method. Therefore, we can stop () method to perform clean-up tasks some resources, such as the release of the database connection.

Once in place Activator class, you can MANIFEST.MF file to the package to pass the legal name of the container. Here we look at the MANIFEST.MF file.

3.1.2. MANIFEST.MF file

Bundle the file is the deployment descriptor, its format and the normal JAR file in the MANIFEST.MF file in the same package, it consists of a series of attributes and values corresponding to the composition of these attributes, the attribute name in the beginning of each line, we can say its head for the property. OSGi specification, you can use the property description of your head to the container Bundle. Your HelloWorld Bundle of MANIFEST.MF file should look as shown in Listing 2:

Source Code Listing 2. Hello World Bundle in the MANIFEST.MF file

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HelloWorld Plug-in Bundle-SymbolicName: com.javaworld.sample.HelloWorld Bundle-Version: 1.0.0 Bundle-Activator: com.javaworld.sample.helloworld.Activator Bundle -Vendor: JAVAWORLD Bundle-Localization: plugin Import-Package: org.osgi.framework; version = "1.3.0"

We take a look at the properties used in this document head:

Bundle-ManifestVersion

The property first told OSGi container, the Bundle will follow the OSGi specification, value of 2 indicates the Bundle and the OSGi specification, version 4 compatible; if the attribute value is 1, then said of the package and the OSGi version 3 or earlier versions.

Bundle-Name

Bundle-based head of the property defines a short, can read the name;

Bundle-SymbolicName

This property defines a head-centered Bundle unique, non-localized name; When you need to access from another a specified Bundles Bundle, you must use the name.

Bundle-Version

The first property gives the version number of this Bundle.

Bundle-Activator

The first gives the property used in this Bundle listener class name, the attribute value is optional. Listeners will Activator in the start () and stop () method of monitoring. In Listing 2, the value of the property first com.javaworld.sample.helloworld.Activator.

Bundle-Vendor

The first property is the expression of the issuers Bundle.

Bundle-Localization

The attribute header contains the localization files in this Bundle location, our HelloWorld Bundle of documents is not localized, but the Eclipse IDE automatically generates the property is still the first

Import-Package

The first attribute defines the Bundle package introduced in Java, I will manage this dependence later sections explain in detail the problem. Now, HelloWorld Bundle is ready, let's run and see its output.

3.2. Run Bundle

I mentioned earlier, Eclipse IDE has a built-in EquinoxOSGi container, you can use it to execute or debug OSGi Bundle. Follow these steps just HelloWorld Bundle:

1) Click Run脿Run ... menu (translators note, in Eclipse3.3, click Run脿Open Run Diglog ... menu);

2) Eclipse will open the "Create, manage and run configuration (new, management and operation of configuration)" dialog box, double-click "EquinoxOSGi Framework" button, Eclipse will open the run-time configuration dialog;

3) In the above dialog, the Name (name) values of the input box to HelloWorld Bundle;

4) You will notice that in the Workspace plug-in directory, there is a plugin called com.javaworld.sample.HelloWorld, select it; in TargetPlatform (target platform), please ensure that the org.eclipse.osgi plug-in is selected . Your Run (Run) dialog box should appear as shown in Figure 1:






Figure 1. HelloWorld Bundle run configuration

5) Now, click the Run (Run) button, you should see the console view, print out the "HelloWorld". In fact, Eclipse is OSGi console to open the console view.

3.2.1. OSGi Panel

OSGi OSGi container console is a command line interface, you can in the console to start, stop, install, update and delete Bundles. In EclipseIDE, please click on the console view has focus, then press the Enter key, then you can see the OSGi prompt, as shown in Figure 2: (translators note, in Eclipse3.3, if you do not see to the OSGi prompt, run the configuration in Figure 1, click the Arguments tab, and then ProgramArguments (process parameters) the input box, type "-console", and then re-run the Bundle).






Figure 2. OSGi console and HelloWorldActivator.java

Here are a few frequently used OSGi command, you can use these commands to interact with the OSGi container.

ss: This command displays all installed Bundles and their status, it will display the Bundle ID, Bundle and Bundle short name of the state; start : This command will start a Bundle; stop : This command will stop A Bundle; update : This command uses the new JAR file to update a Bundle; install : This command will install a new Bundle OSGi container; uninstall : OSGi container unloaded from an installed Bundle.

Please note that these commands are provided for OSGi specification, so you can use them to interact with any OSGi container.

Read here, I hope you OSGi Bundle development with a general understanding.









相关链接:



Taste CorelDRAW10: color docker



Using "replace" one-time elimination of the hard carriage return



Hot Multimedia Creation Tools



Assembly LANGUAGE instruction and by Example



MKV To PSP



ESSO Card From The City To Look Into The Need For Integration



How to convert protected wma to mp3 for ipod



Qingdao Shengli Oilfield Nursing Home Use Maxima



Enjoys a bandwidth 10M 20M 20M exclusive exclusive special price



Storage Inventory And Barcoding



MP4 To WMP



If THE turmoil on Wall Street later to 30 years



AVI To Zune



Samba Can Be The First To Support GPLv3 Break With Concerns



Introduction Games Card



Thursday, October 7, 2010

Credit "to bear the blame," Who back?


Some time ago, I saw major domestic media have reported that the central bank put into use personal credit information database, but in most media reports have described has a plot, Mr. Wang is a place for non-payment of Guangdong Development Bank Credit card annual fee was added in the personal credit database, a bad record, no knowledge of his purchase of agricultural bank loan was rejected.

Similarly, because a friend recently I apply for CITIC Industrial Bank's credit card was refused, and also because of his bad credit record. Through memories, Then he remembered who was in the Guangdong Development Bank to help friends who work for the completion of issuing process over a broad mandate issued credit card, apply for credit cards, said the first year annual fee waiver for the second year, if not paid do not want to continue to use annual fee you can. However, after more than a year without receiving any calls, text messaging, e-mail notice shall pay an annual fee of the case, the Guangdong Development Bank will be directly sent a reminder of the lawyer's letter, This the second year that do not pay annual fee does not work, and has been the payment date ... ... although very happy things finally settled, it is clear that, by banks to add in the personal credit history in a bad record into the aftermath of the incident.

In accordance with the central bank's statement, the national network of individual credit database, whether the future can even pay their individual water, electricity and gas charges are included in the scope of credit history, credit history and personal financial activities will play an increasingly important role. The central bank's super-scale CRM system, number of people covered, the breadth of applications is beyond doubt. However, I work in the financial system through a friend understand that the personal credit database of features is not perfect, and now can not distinguish between malicious and good debt arrears. That is, for a person with intent to defraud, one because of his bad memory and forget to pay a fee and a bank staff as a result of negligence or dereliction of duty in arrears without the knowledge of who they personally credit history credit database may even be the same. If the individual credit database, can only record a delinquent act and no delinquent behavior, can not record the reasons for arrears and assessment is malicious or non-malicious, then functions of this CRM system is also equivalent to a simple notebook, Moreover, some bank staff may not fulfill this obligation in accordance with the workflow (for example, the amount of notification bill, charge date, mortgage or car loan interest rate increases as a result of whether the monthly payment adjustments), then the person probably just made a scapegoat The copies of the.

The author believes that individual credit database, the mind should be put into use in the financial activities of the individual's actual behavior to determine a person's credit rating. However, due to the imperfections of the system, coupled with still no one able to bank credit, service records, assessment, and standardized system of bank staff working attitude, methods can determine your credit rating, and also we can do is frequently used as soon as the card is not all the write-off in the future no more free to work in a bank to help students and friends to complete the task card, after all, more than one card, the more a pair of hands affect your credit record.






Recommended links:



Catalogs Audio CD Players



ASF to MPEG



Shop Games Arcade



Vector graphics on the Description of several concepts



Balanced and non-equilibrium GIS GIS



Feeling so steady and VB API (1)



quot the language dll vbe6intl.dll could not be



ASF To MPG



DreamweaverMX BUILD Guestbook (4)



MOV to MP4



New Office Suites And Tools



Baidu pressed into the C2C site Taobao payment or ism



Congratulations to the Formal establishment of the Pan-micro Jinan Branch



Internal control: harm than good, or at every step



Saturday, September 25, 2010

Bye NetWare, Hello OES 2


Salt Lake City - Novell in March 19th's annual BrainShare trade show was announced the next generation of OES (Open Enterprise Server) operating system. OES 2 adds 64-bit Xen-based virtualization, dynamic storage support, and Windows domain support, and marks from Novell NetWare to SLES (SUSE Linux Enterprise Server) in the final conversion.

銆??鏂扮殑OES鏄瀯寤哄湪鍒氬垰鍙戝竷鐨凷LES 10 SP1涓娿?杩欎釜鎿嶄綔绯荤粺鏀寔Inter鍜孉MD64浣嶅弻鏍革紝浠ュ強澶氭牳澶勭悊鍣ㄣ?

In addition, many of OES's main services - Novell Storage Services, Novell Cluster Services, and some other - have been upgraded to a 64-bit code. Other services as needed with 64-bit 32-bit libraries.

銆??浣跨敤Xen铏氭嫙鍖栵紝OES鐜板湪鍙互璁╃敤鎴蜂滑浠ョ被铏氭嫙鍖栧鎿嶄綔绯荤粺褰㈠紡灏哊etWare 6.5杩愯鍦⊿LES涓婇潰銆?br />
To this class virtualization mode to gain access to the latest hardware to optimize performance, NetWare has also strengthened its way as a virtual machine, Novell said.

Novell's director of product marketing, said Justin Steinman, OES NetWare above to open some very profitable server consolidation possibilities.

銆??鈥滃湪浠婂ぉ鐨勯珮绔‖浠朵笂锛孨etWare寰堝皯濡傛鎺ヨ繎CPU鐨勫畬鍏ㄥ埄鐢ㄧ巼銆傚綋Novell鐨?Open Enterprise Server 2鍑烘潵鐨勬椂鍊欙紝浣犺兘澶熷埄鐢ㄩ偅浜涙病鏈夊厖鍒嗗埄鐢ㄧ殑纭欢鍦ㄤ竴鍙版満鍣ㄤ笂瑁?涓?3涓紝鐢氳嚦鏇村涓狽etWare鏈嶅姟鍣紝鑰屼笉浼氬奖鍝嶅埌鎬ц兘銆傝繖鍙互鏋佸ぇ鍦拌妭鐪佺‖浠舵垚鏈紝鏈烘灦绌洪棿锛屽喎鍗撮渶姹傦紝浠ュ強鐢垫簮闇?眰銆傗?

In the OES 2, Novell also introduced "dynamic storage technology." This new feature allows administrators to create any data provided is active or inactive strategy.






相关链接:



Photoshop Production - Wire And Spark



A flash drive to buy the real experience



3G2 TO MPEG



DVR-MS to MP4



linux automatically next time a Process



Picked Accounting And Finance



ASF Converter



Pan On Why OO + Object-oriented Multi-layer Structure [2]



"China Computer Business 500" Award, Awarded The Two Winning BenQ Chase The Deer



Premier Search Or Lookup Tools



Star Speed: gentleman or "rogue"



Sogou Pinyin input Method Magical Eight



American professional experts: seven double the efficiency and salary tips



reviews E-Mail Clients



Dell Go From Here



Tuesday, September 21, 2010

1 million for the lessons do not come!



Speaking of things that early last year, the task of our factory is very busy.

A friend called his product too late to production we give a hand and a machine can produce two days. We promised down. But things happen so coincidentally, the production strikes a few hours after the machine, I put together with the mechanic machine apart and found a plane bearing bad. Changzhou immediately rushed to buy.

To my old customers and buy a plant on the back and spent more than two small fashion good a machine. I work clothes off, wash players to accompany a friend to drink tea. Chatted for a second 30 minutes before, workers ran for another bad. I was angry to die, I blame the workers back to a few. Workers unhappy face, talk back that I bought was junk goods. I went to check, a look startled. Became the arch-type plane bearing the. Fortunately, no damage to other components. I hastily went to Changzhou. Once there, I and distributors theory, but his look of disdain. Said: "you earned a few dollars on something, what is remarkable."

I have gas, he's a friend for many years but I ah! How would say so. He had made the tools and accessories, but never so bad ah. No matter how I say that he is not willing to refund and replacement. He said something should not say. I do not say. Finally, I leave a relentless: "You do not get things done with no way out. Sooner or later you will regret it."

I can not shop on the other bought and rushed back to the factory. But such a delay is that most of the day passed. My friend was too late delivery of products, this product in other machine tools can not produce. Then I called a friend to talk. He listened very angry. Because he is my business tool to help introduce the dealer. We do not do with other friends that the joint dealer business. Every time I buy a tool in his shop before the time passing by.

So six months down the dealers a bit embarrassing. [Because of such things in our peers spread quickly. I am not a person does not do his business up.] He took the initiative to say hello to me. I'll muddle through.

Finally, he invited me to the store I sincerely apologized tunnel, I began to re-do some business with him. But now the ratio of on to die, 70% of the tools I used to be his. Now 10% of it! I went to the dealer other than it is now much better, because there are more goods, like how bargaining on how sample.

Dealer's loss I get from the other side, is said to have done little more than 200,000. Yeah you are worth the dealer! I do not have rights protection, but this case was even more severe than the 315 complaints to a hundred times.

Summarize a few points;

1. Do not just expected a dealer, to many other places to talk.

2. Found deceived must argue, it is not, can take other approaches.

3. To 315 to complain, to protect their legitimate rights and interests.






Recommended links:



Wizard Games Card



Epson Ink Cartridge Patent New Alternative To The Situation Of Domestic Supplies Of Unknown



VBScript CLng function



Ps3 Ogm



Icons SHOP



Deconstruction Huawei: High investment by foreign forces



Photoshop font effects - Ice text



Video Format For Ps3



Watch cool mechanical Picture production process



Investment Tools SPECIALIST



Qualcomm CEO: WiMax 3G Will Compete In The Face Of Setbacks



Real Player Converter H.264



Realplayer flv



J2ME learning Reviewing the Old Posts



New ONLINE Gaming



Photoshop Font effects - Ice text



Friday, July 30, 2010

Junk mail in orders



E-mail in spam, not the next 20-30 letters a day. Therefore, I have to clean up 3-4 times a day, see if there is no innocent.

Evening of December 11 last year, when the mailbox clean up trash, dozens of messages, there is a title: your inquiry through Alibaba.com, hastened to it rehabilitated into the inbox, then foxmail incorporated into the computer. A look from the customer inquiry Ali English station, the message is the same day to the noon. Not too late, the catalog and price list issued later. 12, customer response, he has to a small cabinet, so that re-quotes. Then re-offer. January 19, 2007, customers sent orders, and confirm the packaging requirements. 29, to confirm payment terms: the former T / T, 30% of pre-production; production is completed, 70% before shipment. Originally thought to complete the list before the Spring Festival, or the receipt of deposit. Result there has been no news client (I do not want to urge customers, after all, more than 40,000 knives list, in full before the T / T, customers may have concerns, urging the more likely the more counterproductive). After the holiday, there is no news. March 2, the customer sent a wire transfer of water alone, more than 10,000 knives deposit. March 6 deposit credited into account, I arrange the production. March 30, the customer sent the wire transfer the balance of water alone. April 2, the balance credited into account. Next Monday or Tuesday, to container loading, and has ordered 14 vessels. Risk it! A list of more than 40,000 knives and was almost thrown away as garbage.

Recommendation: each at least once, into the mail server, check the spam box, see if there were innocent messages. Because many mail servers are equipped with filtering, can not help but have misjudged the situation. One of my classmates, with the company's E-mail send me an email, always put junk mailbox. No clear now how the matter, made me embarrassed.







Recommended links:



ARMED new rural computer



video Mpg



Online Player DIY



Chinese input method commonly used FAST switching



Delphi Control, We Can (1)



Menu



video file Formats



UNAVOIDABLE five "winter" rule



Liang Wang: Whitman's China Troubles



mp4 to wmv Converter free



Evaluate Science - SCREEN Savers



The PROCESS of recording impromptu slide show reaction



My favorite ASP And PHP



Monday, July 12, 2010

Thunder push download genuine risk of transfer of copyright infringement



March 21 news yesterday, the Chinese application software and download engine Thunder network teamed Kyushu Monternet, Herald, goodness, network interconnection and other Chinese mainstream Internet music content providers, and thus proclaimed the legitimate content of the Internet and digital distribution channel operations formal integration.

"This joint, not only marked the parties in Cyberspace viable new model of cooperation, but also from the realization of the true sense of multi-win-win cooperation to promote the sound development of the industry." Thunderbolt official said this. Yet those were of the view that Thunder would not only be able to mitigate and Internet content providers in the competition, and they can transfer the risk of the video's sense of copyright infringement.

It is understood that Thunder had invested heavily in 2007 to cooperate with the purchase of copyrighted content, in April 2007, Thunder held at the Great Hall of the copyright claim activity to support the genuine, legitimate video content to promote the development of the Internet.

But in February of this year, the U.S. subsidiary of the Motion Picture Association of six film production companies will be Thunder to court, the Motion Picture Association has said six American films in Shanghai has filed a civil suit alleged violations of their Thunder copyright, and claims 7 million yuan, while openly admitted piracy is still the case now before the Court of Shanghai Pudong New Area, the first trial results will be sentenced today.







Recommand Link:



Youtube to Xbox 360 Professional



Hope Wii Cell Phone Deconde



mp4 CONVERTER to avi



convert .avi to .wmv



Guide Audio Rippers And Converters



Merry CD APE MP3 ID3 Tag To VQF Copy



Recommend Audio Rippers And Converters



APPLE CD APE RM to OGG Copier



Articles about Kids Education



Merry MP3 M4A to ID3 Cloner



Audio Burner Plus



Mkv



Science - Screen Savers Expert



iKoysoft DVD to PSP Converter



Bliss RM CD to MP3 ID3 Tag BURNER



Ps3 Format



Virtins POCKET Oscilloscope



Wednesday, March 31, 2010

ChainGang


ChainGang is a value for money solution for synchronizing video playback to MIDI timecode or MIDI Clock. Designed for project- and professional level AV and PostPro studios ChainGang frees the main audio production hard- and software from the burden of in-sequencer videoplayback by passing that task to laptops or additional machines that may stand around unused.
As more and more tone generation and audio processing is performed by plugins and virtual instruments, the deployment cycles of DAW PCs seem to become shorter and shorter. ChainGang potentially can help you squeeze another year out of your hardware by offloading video to a secondary computer for just fractions of the costs of an all new system.




Recommand Link:



Change M4v To Epson P-2000 Extension