diff options
author | Eike Stepper | 2007-07-07 05:36:24 -0400 |
---|---|---|
committer | Eike Stepper | 2007-07-07 05:36:24 -0400 |
commit | 7ed99801715e435108708ddf721820ccf576af00 (patch) | |
tree | 7248d26532f7635897ee5d89a33279ababacdfa6 | |
parent | 1f5ddf4721a15bc9a0b755b9a1352a6f757fae62 (diff) | |
download | cdo-7ed99801715e435108708ddf721820ccf576af00.zip cdo-7ed99801715e435108708ddf721820ccf576af00.tar.gz cdo-7ed99801715e435108708ddf721820ccf576af00.tar.xz |
task 1: Develop 0.8.0
58 files changed, 1773 insertions, 355 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/.classpath b/plugins/org.eclipse.emf.cdo.server.db/.classpath new file mode 100644 index 0000000..751c8f2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.emf.cdo.server.db/.cvsignore b/plugins/org.eclipse.emf.cdo.server.db/.cvsignore new file mode 100644 index 0000000..6938697 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/.cvsignore @@ -0,0 +1,2 @@ +bin +doc diff --git a/plugins/org.eclipse.emf.cdo.server.db/.options b/plugins/org.eclipse.emf.cdo.server.db/.options new file mode 100644 index 0000000..87bfd15 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/.options @@ -0,0 +1 @@ +org.eclipse.emf.cdo.server.jdbc/debug = true diff --git a/plugins/org.eclipse.emf.cdo.server.db/.project b/plugins/org.eclipse.emf.cdo.server.db/.project new file mode 100644 index 0000000..ae20807 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.emf.cdo.server.db</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0ac4917 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.emf.cdo.server.db +Bundle-Version: 0.8.0.qualifier +Bundle-Activator: org.eclipse.emf.cdo.server.internal.db.bundle.OM$Activator +Bundle-Vendor: %providerName +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.net4j.db;visibility:=reexport, + org.eclipse.emf.cdo.server;visibility:=reexport +Eclipse-LazyStart: true diff --git a/plugins/org.eclipse.emf.cdo.server.db/about.html b/plugins/org.eclipse.emf.cdo.server.db/about.html new file mode 100644 index 0000000..81a265f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/about.html @@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + + <head> + + <meta content="text/html; charset=ISO-8859-1" + http-equiv="Content-Type"/> + + <title>About</title> + + </head> + + <body lang="EN-US"> + + <h2>About This Content</h2> + + <p>May 17, 2007</p> + + <h3>License</h3> + + <p>The Eclipse Foundation makes available all content in this + plug-in ("Content"). Unless otherwise indicated below, + the Content is provided to you under the terms and conditions of + the Eclipse Public License Version 1.0 ("EPL"). A copy of + the EPL is available at + <a href="http://www.eclipse.org/legal/epl-v10.html"> + http://www.eclipse.org/legal/epl-v10.html</a>. For purposes of the + EPL, "Program" will mean the Content.</p> + + <p>If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If + no such license exists, contact the Redistributor. Unless otherwise + indicated below, the terms and conditions of the EPL still apply to + any source code in the Content.</p> + + </body> + +</html> + diff --git a/plugins/org.eclipse.emf.cdo.server.db/build.properties b/plugins/org.eclipse.emf.cdo.server.db/build.properties new file mode 100644 index 0000000..b3ba16b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + .options,\ + about.html,\ + copyright.txt,\ + epl-v10.html,\ + license.html diff --git a/plugins/org.eclipse.emf.cdo.server.db/copyright.txt b/plugins/org.eclipse.emf.cdo.server.db/copyright.txt new file mode 100644 index 0000000..025f152 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2007 Eike Stepper, Germany. +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl-v10.html + +Contributors: + Eike Stepper - initial API and implementation
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.db/epl-v10.html b/plugins/org.eclipse.emf.cdo.server.db/epl-v10.html new file mode 100644 index 0000000..d7b88e9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.db/license.html b/plugins/org.eclipse.emf.cdo.server.db/license.html new file mode 100644 index 0000000..d7b88e9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java new file mode 100644 index 0000000..439d10f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.db; + +import org.eclipse.emf.cdo.internal.server.bundle.OM; +import org.eclipse.emf.cdo.server.internal.db.CDODBStoreManager; + +import org.eclipse.net4j.db.DBUtil; +import org.eclipse.net4j.db.IDBAdapter; + +import javax.sql.DataSource; + +import java.util.Properties; + +/** + * @author Eike Stepper + */ +public final class CDODBUtil +{ + private CDODBUtil() + { + } + + public static CDODBStoreManager getStoreManager(IDBAdapter dbAdapter, DataSource dataSource) + { + CDODBStoreManager storeManager = new CDODBStoreManager(dbAdapter, dataSource); + storeManager.initDatabase(); + return storeManager; + } + + public static CDODBStoreManager getStoreManager() + { + Properties properties = OM.BUNDLE.getConfigProperties(); + String adapterName = properties.getProperty("store.adapterName", "derby"); + IDBAdapter dbAdapter = DBUtil.getDBAdapter(adapterName); + DataSource dataSource = DBUtil.createDataSource(properties, "datasource"); + return getStoreManager(dbAdapter, dataSource); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java new file mode 100644 index 0000000..8955607 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.db; + +import org.eclipse.net4j.db.IDBField; +import org.eclipse.net4j.db.IDBIndex; +import org.eclipse.net4j.db.IDBTable; +import org.eclipse.net4j.internal.db.DBSchema; + +/** + * @author Eike Stepper + */ +public class CDODBSchema extends DBSchema +{ + public static final CDODBSchema INSTANCE = new CDODBSchema(); + + /** + * DBTable Destinations + */ + public static final IDBTable DESTINATIONS = INSTANCE.addTable("destinations"); + + public static final IDBField DESTINATIONS_NAME = // + DESTINATIONS.addField("name", IDBField.Type.VARCHAR, 255); + + public static final IDBField DESTINATIONS_TYPE = // + DESTINATIONS.addField("type", IDBField.Type.INTEGER); + + public static final IDBIndex INDEX_DESTINATIONS_PK = // + DESTINATIONS.addIndex(IDBIndex.Type.PRIMARY_KEY, DESTINATIONS_NAME); + + /** + * DBTable Messages + */ + public static final IDBTable MESSAGES = INSTANCE.addTable("messages"); + + public static final IDBField MESSAGES_ID = // + MESSAGES.addField("id", IDBField.Type.VARCHAR); + + public static final IDBField MESSAGES_DESTINATION = // + MESSAGES.addField("destination", IDBField.Type.VARCHAR); + + public static final IDBField MESSAGES_PRIORITY = // + MESSAGES.addField("priority", IDBField.Type.INTEGER); + + public static final IDBIndex INDEX_MESSAGES_PK = // + MESSAGES.addIndex(IDBIndex.Type.PRIMARY_KEY, MESSAGES_ID); + + /** + * Queries + */ + public static final String QUERY = "SELECT " + DESTINATIONS_TYPE + ", " + MESSAGES_ID + ", " + MESSAGES_PRIORITY + + " FROM " + DESTINATIONS + ", " + MESSAGES + " WHERE " + DESTINATIONS_NAME + "=" + MESSAGES_DESTINATION + + " AND " + DESTINATIONS_NAME + "=?"; + + private CDODBSchema() + { + super("JMS"); + } + + static + { + INSTANCE.lock(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBStoreManager.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBStoreManager.java new file mode 100644 index 0000000..8f480dd --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBStoreManager.java @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.db; + +import org.eclipse.net4j.db.IDBAdapter; +import org.eclipse.net4j.internal.db.DBStoreManager; + +import javax.sql.DataSource; + +import java.sql.Connection; + +/** + * @author Eike Stepper + */ +public class CDODBStoreManager extends DBStoreManager<CDODBTransaction> +{ + public CDODBStoreManager(IDBAdapter dbAdapter, DataSource dataSource) + { + super(CDODBSchema.INSTANCE, dbAdapter, dataSource); + } + + @Override + protected CDODBTransaction createTransaction(Connection connection) + { + return new CDODBTransaction(this, connection); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBTransaction.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBTransaction.java new file mode 100644 index 0000000..13c9795 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBTransaction.java @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.db; + +import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl; +import org.eclipse.emf.cdo.protocol.CDOID; +import org.eclipse.emf.cdo.server.ITransaction; + +import org.eclipse.net4j.internal.db.DBStoreTransaction; +import org.eclipse.net4j.util.store.IStoreManager; +import org.eclipse.net4j.util.store.IStoreTransaction; + +import java.sql.Connection; + +/** + * @author Eike Stepper + */ +public class CDODBTransaction extends DBStoreTransaction implements ITransaction +{ + public CDODBTransaction(IStoreManager<? extends IStoreTransaction> storeManager, Connection connection) + { + super(storeManager, connection); + } + + public CDOID loadResourceID(String path) + { + return null; + } + + public String loadResourcePath(CDOID id) + { + return null; + } + + public CDORevisionImpl loadRevision(CDOID id) + { + return null; + } + + public CDORevisionImpl loadRevision(CDOID id, long timeStamp) + { + return null; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java new file mode 100644 index 0000000..fb77f3d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server.internal.db.bundle; + +import org.eclipse.net4j.internal.util.om.OSGiActivator; +import org.eclipse.net4j.util.om.OMBundle; +import org.eclipse.net4j.util.om.OMLogger; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.OMTracer; + +/** + * @author Eike Stepper + */ +public final class OM +{ + public static final String BUNDLE_ID = "org.eclipse.emf.cdo.server.db"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + private OM() + { + } + + public static final class Activator extends OSGiActivator + { + @Override + protected OMBundle getOMBundle() + { + return BUNDLE; + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF index f490262..71667f9 100644 --- a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF @@ -5,6 +5,7 @@ Bundle-SymbolicName: org.eclipse.emf.cdo.server;singleton:=true Bundle-Version: 0.8.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName +Bundle-Activator: org.eclipse.emf.cdo.internal.server.bundle.OM$Activator Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 Export-Package: org.eclipse.emf.cdo.internal.server;version="0.8.0", @@ -15,4 +16,3 @@ Require-Bundle: org.eclipse.core.runtime;resolution:=optional, org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.cdo.protocol;bundle-version="0.8.0";visibility:=reexport Eclipse-LazyStart: true -Bundle-Activator: org.eclipse.emf.cdo.internal.server.bundle.Activator$Implementation diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java index b19de75..da036e6 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java @@ -10,12 +10,14 @@ **************************************************************************/ package org.eclipse.emf.cdo.internal.server; -import org.eclipse.emf.cdo.server.IStoreTransaction; +import org.eclipse.emf.cdo.server.ITransaction; + +import org.eclipse.net4j.internal.util.store.StoreManager; /** * @author Eike Stepper */ -public class EmptyStoreManager extends StoreManager +public class EmptyStoreManager extends StoreManager<ITransaction> { private static final String STORE_TYPE = "EMPTY"; @@ -25,16 +27,16 @@ public class EmptyStoreManager extends StoreManager setInstanceID(STORE_TYPE); } - public IStoreTransaction startTransaction() + public ITransaction startTransaction() { return new EmptyStoreTransaction(this); } - public void commitTransaction(IStoreTransaction transaction) + public void commitTransaction(ITransaction transaction) { } - public void rollbackTransaction(IStoreTransaction transaction) + public void rollbackTransaction(ITransaction transaction) { } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java index 44ac32a..20f86e9 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java @@ -10,14 +10,40 @@ **************************************************************************/ package org.eclipse.emf.cdo.internal.server; +import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl; +import org.eclipse.emf.cdo.protocol.CDOID; +import org.eclipse.emf.cdo.server.ITransaction; + +import org.eclipse.net4j.internal.util.store.StoreTransaction; +import org.eclipse.net4j.util.store.IStoreManager; /** * @author Eike Stepper */ -public class EmptyStoreTransaction extends StoreTransaction +public class EmptyStoreTransaction extends StoreTransaction implements ITransaction { - public EmptyStoreTransaction(StoreManager store) + public EmptyStoreTransaction(IStoreManager<ITransaction> storeManager) + { + super(storeManager); + } + + public CDOID loadResourceID(String path) + { + return null; + } + + public String loadResourcePath(CDOID id) + { + return null; + } + + public CDORevisionImpl loadRevision(CDOID id, long timeStamp) + { + return null; + } + + public CDORevisionImpl loadRevision(CDOID id) { - super(store); + return null; } }
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java index a920cb0..b809be6 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java @@ -13,7 +13,9 @@ package org.eclipse.emf.cdo.internal.server; import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl; import org.eclipse.emf.cdo.protocol.CDOID; import org.eclipse.emf.cdo.server.IRepository; -import org.eclipse.emf.cdo.server.IStoreManager; +import org.eclipse.emf.cdo.server.ITransaction; + +import org.eclipse.net4j.util.store.IStoreManager; import java.util.UUID; @@ -34,7 +36,7 @@ public class Repository implements IRepository private RevisionManager revisionManager; - private IStoreManager storeManager; + private IStoreManager<ITransaction> storeManager; private long nextOIDValue = INITIAL_OID_VALUE; @@ -45,6 +47,7 @@ public class Repository implements IRepository sessionManager = new SessionManager(this); resourceManager = new ResourceManager(this); revisionManager = new RevisionManager(this); + storeManager = new EmptyStoreManager(); } public String getName() @@ -72,7 +75,7 @@ public class Repository implements IRepository return revisionManager; } - public IStoreManager getStoreManager() + public IStoreManager<ITransaction> getStoreManager() { return storeManager; } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManager.java index 412bbf0..124f7a8 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManager.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManager.java @@ -10,9 +10,10 @@ **************************************************************************/ package org.eclipse.emf.cdo.internal.server; -import org.eclipse.emf.cdo.internal.server.bundle.CDOServer; +import org.eclipse.emf.cdo.internal.server.bundle.OM; import org.eclipse.emf.cdo.protocol.CDOID; import org.eclipse.emf.cdo.server.IResourceManager; +import org.eclipse.emf.cdo.server.StoreUtil; import org.eclipse.net4j.util.om.trace.ContextTracer; @@ -24,7 +25,7 @@ import java.util.Map; */ public class ResourceManager implements IResourceManager { - private static final ContextTracer TRACER = new ContextTracer(CDOServer.DEBUG_SESSION, SessionManager.class); + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SESSION, SessionManager.class); private Repository repository; @@ -82,13 +83,11 @@ public class ResourceManager implements IResourceManager private CDOID loadID(String path) { - // TODO Implement method ResourceManager.loadID() - throw new UnsupportedOperationException("Not yet implemented"); + return StoreUtil.getTransaction().loadResourceID(path); } private String loadPath(CDOID id) { - // TODO Implement method ResourceManager.loadPath() - throw new UnsupportedOperationException("Not yet implemented"); + return StoreUtil.getTransaction().loadResourcePath(id); } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java index ecd4f1e..71d6115 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java @@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl; import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionResolverImpl; import org.eclipse.emf.cdo.protocol.CDOID; import org.eclipse.emf.cdo.server.IRevisionManager; +import org.eclipse.emf.cdo.server.StoreUtil; /** * @author Eike Stepper @@ -47,14 +48,12 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio @Override protected CDORevisionImpl loadRevision(CDOID id) { - // TODO Implement method RevisionManager.loadRevision() - throw new UnsupportedOperationException("Not yet implemented"); + return StoreUtil.getTransaction().loadRevision(id); } @Override protected CDORevisionImpl loadRevision(CDOID id, long timeStamp) { - // TODO Implement method RevisionManager.loadRevision() - throw new UnsupportedOperationException("Not yet implemented"); + return StoreUtil.getTransaction().loadRevision(id, timeStamp); } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java index ec4387c..daa9449 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java @@ -11,7 +11,7 @@ package org.eclipse.emf.cdo.internal.server; import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl; -import org.eclipse.emf.cdo.internal.server.bundle.CDOServer; +import org.eclipse.emf.cdo.internal.server.bundle.OM; import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol; import org.eclipse.emf.cdo.internal.server.protocol.InvalidationRequest; import org.eclipse.emf.cdo.server.ISession; @@ -57,7 +57,7 @@ public class Session implements ISession } catch (Exception ex) { - CDOServer.LOG.error(ex); + OM.LOG.error(ex); } } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java index d299f99..a54fc69 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java @@ -11,7 +11,7 @@ package org.eclipse.emf.cdo.internal.server; import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl; -import org.eclipse.emf.cdo.internal.server.bundle.CDOServer; +import org.eclipse.emf.cdo.internal.server.bundle.OM; import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol; import org.eclipse.emf.cdo.server.ISessionManager; @@ -25,7 +25,7 @@ import java.util.Map; */ public class SessionManager implements ISessionManager { - private static final ContextTracer TRACER = new ContextTracer(CDOServer.DEBUG_SESSION, SessionManager.class); + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SESSION, SessionManager.class); private Repository repository; diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/Activator.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/Activator.java deleted file mode 100644 index 2cb425a..0000000 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.emf.cdo.internal.server.bundle; - -import org.eclipse.emf.common.EMFPlugin; -import org.eclipse.emf.common.util.ResourceLocator; - -import org.osgi.framework.BundleContext; - -public final class Activator extends EMFPlugin -{ - // @Singleton - public static final Activator INSTANCE = new Activator(); - - private static Implementation plugin; - - public Activator() - { - super(new ResourceLocator[] {}); - } - - public ResourceLocator getPluginResourceLocator() - { - return plugin; - } - - public static Implementation getPlugin() - { - return plugin; - } - - public static class Implementation extends EclipsePlugin - { - public Implementation() - { - plugin = this; - } - - @Override - public void start(BundleContext context) throws Exception - { - super.start(context); - CDOServer.BUNDLE.setBundleContext(context); - } - - @Override - public void stop(BundleContext context) throws Exception - { - plugin = null; - CDOServer.BUNDLE.setBundleContext(null); - super.stop(context); - } - } - -} diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/CDOServer.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java index a52c898..eefb2aa 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/CDOServer.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java @@ -10,6 +10,7 @@ **************************************************************************/ package org.eclipse.emf.cdo.internal.server.bundle; +import org.eclipse.net4j.internal.util.om.OSGiActivator; import org.eclipse.net4j.util.om.OMBundle; import org.eclipse.net4j.util.om.OMLogger; import org.eclipse.net4j.util.om.OMPlatform; @@ -18,11 +19,11 @@ import org.eclipse.net4j.util.om.OMTracer; /** * @author Eike Stepper */ -public final class CDOServer +public final class OM { public static final String BUNDLE_ID = "org.eclipse.emf.cdo.server"; //$NON-NLS-1$ - public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, CDOServer.class); + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ @@ -36,7 +37,16 @@ public final class CDOServer public static final OMLogger LOG = BUNDLE.logger(); - private CDOServer() + private OM() { } + + public static final class Activator extends OSGiActivator + { + @Override + protected OMBundle getOMBundle() + { + return BUNDLE; + } + } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java index e040f76..0f597f2 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java @@ -15,8 +15,12 @@ import org.eclipse.emf.cdo.internal.server.ResourceManager; import org.eclipse.emf.cdo.internal.server.RevisionManager; import org.eclipse.emf.cdo.internal.server.Session; import org.eclipse.emf.cdo.internal.server.SessionManager; +import org.eclipse.emf.cdo.server.ITransaction; +import org.eclipse.emf.cdo.server.StoreUtil; import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.store.IStoreManager; +import org.eclipse.net4j.util.store.StoreException; /** * @author Eike Stepper @@ -51,6 +55,11 @@ public abstract class CDOServerIndication extends IndicationWithResponse return getRepository().getResourceManager(); } + protected IStoreManager<ITransaction> getStoreManager() + { + return getRepository().getStoreManager(); + } + protected Repository getRepository() { return getSessionManager().getRepository(); @@ -61,8 +70,14 @@ public abstract class CDOServerIndication extends IndicationWithResponse return getProtocol().getSession(); } + @Override protected CDOServerProtocol getProtocol() { return (CDOServerProtocol)super.getProtocol(); } + + protected void transact(Runnable runnable) throws StoreException + { + StoreUtil.transact(getStoreManager(), runnable); + } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java index 7cbb82e..894e29a 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java @@ -112,11 +112,17 @@ public class CommitTransactionIndication extends CDOServerIndication timeStamp = System.currentTimeMillis(); out.writeLong(timeStamp); - addRevisions(newResources); - addRevisions(newObjects); - addRevisions(dirtyObjects); - writeIDMappings(out); + transact(new Runnable() + { + public void run() + { + addRevisions(newResources); + addRevisions(newObjects); + addRevisions(dirtyObjects); + } + }); + writeIDMappings(out); if (dirtyObjects.length > 0) { getSessionManager().notifyInvalidation(timeStamp, dirtyObjects, getSession()); diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java index eef8864..c5277b6 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java @@ -63,8 +63,16 @@ public class LoadObjectIndication extends CDOServerIndication @Override protected void responding(ExtendedDataOutputStream out) throws IOException { - RevisionManager rm = getRevisionManager(); - CDORevisionImpl revision = timeStamp != null ? rm.getRevision(id, timeStamp) : rm.getRevision(id); - revision.write(out, null); + final CDORevisionImpl[] revision = new CDORevisionImpl[1]; + transact(new Runnable() + { + public void run() + { + RevisionManager rm = getRevisionManager(); + revision[0] = timeStamp != null ? rm.getRevision(id, timeStamp) : rm.getRevision(id); + } + }); + + revision[0].write(out, null); } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java index 615940d..c8fa00b 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java @@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.internal.server.protocol; import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl; import org.eclipse.emf.cdo.internal.protocol.bundle.CDOProtocol; -import org.eclipse.emf.cdo.internal.server.bundle.CDOServer; +import org.eclipse.emf.cdo.internal.server.bundle.OM; import org.eclipse.emf.cdo.protocol.CDOID; import org.eclipse.emf.cdo.protocol.CDOProtocolConstants; @@ -41,7 +41,7 @@ public class ResourceIDIndication extends CDOServerIndication protected void indicating(ExtendedDataInputStream in) throws IOException { // TODO Optimize transfer of URIs/paths - String path = in.readString(); + final String path = in.readString(); if (PROTOCOL.isEnabled()) { PROTOCOL.format("Read path: {0}", path); @@ -49,11 +49,17 @@ public class ResourceIDIndication extends CDOServerIndication try { - id = getResourceManager().getResourceID(path); + transact(new Runnable() + { + public void run() + { + id = getResourceManager().getResourceID(path); + } + }); } catch (Exception ex) { - CDOServer.LOG.error(ex); + OM.LOG.error(ex); id = CDOID.NULL; } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java index ff716d8..557ee75 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java @@ -39,13 +39,19 @@ public class ResourcePathIndication extends CDOServerIndication @Override protected void indicating(ExtendedDataInputStream in) throws IOException { - CDOID id = CDOIDImpl.read(in); + final CDOID id = CDOIDImpl.read(in); if (PROTOCOL.isEnabled()) { PROTOCOL.format("Read ID: {0}", id); } - path = getResourceManager().getResourcePath(id); + transact(new Runnable() + { + public void run() + { + path = getResourceManager().getResourcePath(id); + } + }); } @Override diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java index d3cebe4..fcce731 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java @@ -10,6 +10,8 @@ **************************************************************************/ package org.eclipse.emf.cdo.server; +import org.eclipse.net4j.util.store.IStoreManager; + /** * @author Eike Stepper */ @@ -25,5 +27,5 @@ public interface IRepository public IRevisionManager getRevisionManager(); - public IStoreManager getStoreManager(); + public IStoreManager<ITransaction> getStoreManager(); } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ITransaction.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ITransaction.java new file mode 100644 index 0000000..aed298a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ITransaction.java @@ -0,0 +1,30 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server; + +import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl; +import org.eclipse.emf.cdo.protocol.CDOID; + +import org.eclipse.net4j.util.store.IStoreTransaction; + +/** + * @author Eike Stepper + */ +public interface ITransaction extends IStoreTransaction +{ + public CDOID loadResourceID(String path); + + public String loadResourcePath(CDOID id); + + public CDORevisionImpl loadRevision(CDOID id); + + public CDORevisionImpl loadRevision(CDOID id, long timeStamp); +} diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreUtil.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreUtil.java new file mode 100644 index 0000000..25c4f2e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreUtil.java @@ -0,0 +1,86 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.server; + +import org.eclipse.net4j.util.store.IStoreManager; +import org.eclipse.net4j.util.store.StoreException; +import org.eclipse.net4j.util.store.IStoreManager.TransactedOperation; + +/** + * @author Eike Stepper + */ +public final class StoreUtil +{ + private static ThreadLocal<ITransaction> cdotx = new InheritableThreadLocal(); + + private StoreUtil() + { + } + + public static void transact(IStoreManager<ITransaction> storeManager, final Runnable runnable) throws StoreException + { + TransactedOperation operation = new TransactedOperation<ITransaction>() + { + public void run(ITransaction transaction) throws Exception + { + setTransaction(transaction); + try + { + runnable.run(); + } + finally + { + unsetTransaction(); + } + } + }; + + storeManager.transact(operation); + } + + public static ITransaction getTransaction() + { + ITransaction transaction = cdotx.get(); + if (transaction == null) + { + throw new IllegalStateException("No transaction ongoing"); + } + + return transaction; + } + + private static void setTransaction(ITransaction transaction) + { + if (transaction == null) + { + throw new IllegalArgumentException("transaction == null"); + } + + ITransaction existingTransaction = cdotx.get(); + if (existingTransaction != null) + { + throw new IllegalStateException("Transaction already ongoing"); + } + + cdotx.set(transaction); + } + + private static void unsetTransaction() + { + ITransaction transaction = cdotx.get(); + if (transaction == null) + { + throw new IllegalStateException("No transaction ongoing"); + } + + cdotx.set(null); + } +} diff --git a/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch b/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch index 7b3d40b..6e95bc2 100644 --- a/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch +++ b/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch @@ -5,7 +5,7 @@ <booleanAttribute key="automaticValidate" value="false"/> <stringAttribute key="bootstrap" value=""/> <stringAttribute key="checked" value="org.eclipse.emf.cdo,org.eclipse.emf.cdo.protocol,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.ui,org.eclipse.net4j,org.eclipse.net4j.jvm,org.eclipse.net4j.tcp,org.eclipse.net4j.ui"/> -<booleanAttribute key="clearConfig" value="false"/> +<booleanAttribute key="clearConfig" value="true"/> <booleanAttribute key="clearws" value="false"/> <booleanAttribute key="clearwslog" value="false"/> <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/CDO UI"/> @@ -20,7 +20,7 @@ <stringAttribute key="product" value="org.eclipse.sdk.ide"/> <stringAttribute key="selectedPlugin" value="org.eclipse.net4j"/> <stringAttribute key="selected_target_plugins" value="com.ibm.icu,com.jcraft.jsch,javax.servlet,javax.servlet.jsp,org.apache.ant,org.apache.commons.el,org.apache.commons.logging,org.apache.jasper,org.apache.lucene,org.apache.lucene.analysis,org.eclipse.ant.core,org.eclipse.ant.ui,org.eclipse.compare,org.eclipse.core.boot,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.databinding,org.eclipse.core.databinding.beans,org.eclipse.core.expressions,org.eclipse.core.filebuffers,org.eclipse.core.filesystem,org.eclipse.core.filesystem.win32.x86,org.eclipse.core.jobs,org.eclipse.core.net,org.eclipse.core.resources,org.eclipse.core.resources.compatibility,org.eclipse.core.resources.win32,org.eclipse.core.runtime,org.eclipse.core.runtime.compatibility,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.core.variables,org.eclipse.cvs,org.eclipse.cvs.source,org.eclipse.debug.core,org.eclipse.debug.ui,org.eclipse.emf,org.eclipse.emf.ant,org.eclipse.emf.cheatsheets,org.eclipse.emf.codegen,org.eclipse.emf.codegen.ecore,org.eclipse.emf.codegen.ecore.ui,org.eclipse.emf.codegen.ui,org.eclipse.emf.common,org.eclipse.emf.common.ui,org.eclipse.emf.commonj.sdo,org.eclipse.emf.converter,org.eclipse.emf.doc,org.eclipse.emf.ecore,org.eclipse.emf.ecore.change,org.eclipse.emf.ecore.change.edit,org.eclipse.emf.ecore.edit,org.eclipse.emf.ecore.editor,org.eclipse.emf.ecore.sdo,org.eclipse.emf.ecore.sdo.doc,org.eclipse.emf.ecore.sdo.edit,org.eclipse.emf.ecore.sdo.editor,org.eclipse.emf.ecore.sdo.source,org.eclipse.emf.ecore.xmi,org.eclipse.emf.edit,org.eclipse.emf.edit.ui,org.eclipse.emf.exporter,org.eclipse.emf.importer,org.eclipse.emf.importer.ecore,org.eclipse.emf.importer.java,org.eclipse.emf.importer.rose,org.eclipse.emf.mapping,org.eclipse.emf.mapping.ecore2ecore,org.eclipse.emf.mapping.ecore2ecore.editor,org.eclipse.emf.mapping.ecore2xml,org.eclipse.emf.mapping.ecore2xml.ui,org.eclipse.emf.mapping.ui,org.eclipse.emf.mapping.xsd2ecore,org.eclipse.emf.mapping.xsd2ecore.editor,org.eclipse.emf.source,org.eclipse.equinox.app,org.eclipse.equinox.common,org.eclipse.equinox.http.jetty,org.eclipse.equinox.http.registry,org.eclipse.equinox.http.servlet,org.eclipse.equinox.jsp.jasper,org.eclipse.equinox.jsp.jasper.registry,org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.help.appserver,org.eclipse.help.base,org.eclipse.help.ui,org.eclipse.help.webapp,org.eclipse.jdt,org.eclipse.jdt.apt.core,org.eclipse.jdt.apt.ui,org.eclipse.jdt.compiler.apt,org.eclipse.jdt.compiler.tool,org.eclipse.jdt.core,org.eclipse.jdt.core.manipulation,org.eclipse.jdt.debug,org.eclipse.jdt.debug.ui,org.eclipse.jdt.doc.isv,org.eclipse.jdt.doc.user,org.eclipse.jdt.junit,org.eclipse.jdt.junit.runtime,org.eclipse.jdt.junit4.runtime,org.eclipse.jdt.launching,org.eclipse.jdt.source,org.eclipse.jdt.ui,org.eclipse.jface,org.eclipse.jface.databinding,org.eclipse.jface.text,org.eclipse.jsch.core,org.eclipse.ltk.core.refactoring,org.eclipse.ltk.ui.refactoring,org.eclipse.osgi,org.eclipse.osgi.services,org.eclipse.osgi.util,org.eclipse.pde,org.eclipse.pde.build,org.eclipse.pde.core,org.eclipse.pde.doc.user,org.eclipse.pde.junit.runtime,org.eclipse.pde.runtime,org.eclipse.pde.source,org.eclipse.pde.ui,org.eclipse.pde.ui.templates,org.eclipse.platform,org.eclipse.platform.doc.isv,org.eclipse.platform.source,org.eclipse.platform.source.win32.win32.x86,org.eclipse.rcp,org.eclipse.rcp.source,org.eclipse.rcp.source.win32.win32.x86,org.eclipse.sdk,org.eclipse.search,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.team.core,org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui,org.eclipse.text,org.eclipse.tomcat,org.eclipse.ui,org.eclipse.ui.browser,org.eclipse.ui.cheatsheets,org.eclipse.ui.console,org.eclipse.ui.editors,org.eclipse.ui.externaltools,org.eclipse.ui.forms,org.eclipse.ui.ide,org.eclipse.ui.ide.application,org.eclipse.ui.intro,org.eclipse.ui.intro.universal,org.eclipse.ui.navigator,org.eclipse.ui.navigator.resources,org.eclipse.ui.presentations.r21,org.eclipse.ui.views,org.eclipse.ui.views.properties.tabbed,org.eclipse.ui.win32,org.eclipse.ui.workbench,org.eclipse.ui.workbench.compatibility,org.eclipse.ui.workbench.texteditor,org.eclipse.update.configurator,org.eclipse.update.core,org.eclipse.update.core.win32,org.eclipse.update.scheduler,org.eclipse.update.ui,org.eclipse.xsd,org.eclipse.xsd.cheatsheets,org.eclipse.xsd.doc,org.eclipse.xsd.ecore.exporter,org.eclipse.xsd.ecore.importer,org.eclipse.xsd.edit,org.eclipse.xsd.editor,org.eclipse.xsd.source,org.junit,org.junit4,org.mortbay.jetty"/> -<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.protocol,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.edit,org.eclipse.emf.cdo,org.eclipse.emf.cdo.tests.model1.edit,org.eclipse.emf.cdo.tests.model1,org.eclipse.net4j,org.eclipse.net4j.tcp,org.eclipse.net4j.ui"/> +<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.protocol,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.edit,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server.db,org.eclipse.emf.cdo.tests.model1.edit,org.eclipse.net4j.db.derby,org.eclipse.net4j.db,org.eclipse.net4j,org.eclipse.emf.cdo.tests.model1,org.eclipse.net4j.tcp,org.eclipse.net4j.ui"/> <stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/> <booleanAttribute key="tracing" value="true"/> <mapAttribute key="tracingOptions"> @@ -38,22 +38,22 @@ <mapEntry key="org.eclipse.ui/trace/contexts" value="false"/> <mapEntry key="org.eclipse.wst.common.environment/trace/error" value="true"/> <mapEntry key="org.eclipse.debug.ui/debug/viewers/updateSequence" value="false"/> -<mapEntry key="org.eclipse.emf.validation/debug/exceptions/throwing" value="false"/> <mapEntry key="org.eclipse.wst.common.environment/trace/warning" value="true"/> +<mapEntry key="org.eclipse.emf.validation/debug/exceptions/throwing" value="false"/> <mapEntry key="org.eclipse.osgi/trace/filename" value="runtime.traces"/> <mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder" value="false"/> -<mapEntry key="org.eclipse.debug.ui/debug/contextlaunching" value="false"/> -<mapEntry key="org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields" value="true"/> <mapEntry key="org.eclipse.jdt.core/debug" value="true"/> +<mapEntry key="org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields" value="true"/> +<mapEntry key="org.eclipse.debug.ui/debug/contextlaunching" value="false"/> <mapEntry key="org.eclipse.osgi/eclipseadaptor/debug" value="false"/> <mapEntry key="org.eclipse.net4j.tcp/debug" value="true"/> <mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/> <mapEntry key="org.eclipse.emf.cdo.server/debug.repository" value="true"/> <mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/> -<mapEntry key="org.eclipse.emf.ocl/debug/exceptions/throwing" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/contentOutline" value="false"/> -<mapEntry key="org.eclipse.wtp.common/debug/logtrace" value="false"/> +<mapEntry key="org.eclipse.emf.ocl/debug/exceptions/throwing" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/preferences-properties" value="false"/> +<mapEntry key="org.eclipse.wtp.common/debug/logtrace" value="false"/> <mapEntry key="org.eclipse.ui.intro/trace/printHTML" value="false"/> <mapEntry key="org.eclipse.emf.query.ocl/debug" value="true"/> <mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/createChanges" value="300"/> @@ -61,39 +61,39 @@ <mapEntry key="org.eclipse.net4j.util/debug.lifecycle.dump" value="true"/> <mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPerspectiveListener" value="false"/> <mapEntry key="org.eclipse.emf.cdo/debug.util" value="true"/> -<mapEntry key="org.eclipse.wst.sse.ui/propertySheet" value="false"/> <mapEntry key="org.eclipse.osgi/resolver/debug" value="false"/> +<mapEntry key="org.eclipse.wst.sse.ui/propertySheet" value="false"/> <mapEntry key="org.eclipse.team.core/refreshjob" value="false"/> -<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> <mapEntry key="org.eclipse.ui/debug" value="false"/> +<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> <mapEntry key="org.eclipse.wtp.common/debug/loglevel" value="WARNING"/> <mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/> <mapEntry key="org.eclipse.pde.core/classpath" value="false"/> <mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/> <mapEntry key="org.eclipse.equinox.preferences/general" value="false"/> <mapEntry key="org.eclipse.net4j.jms.server/debug.store" value="true"/> -<mapEntry key="org.eclipse.wst.sse.core/format" value="false"/> <mapEntry key="org.eclipse.ui/trace/handlers.performance" value="false"/> +<mapEntry key="org.eclipse.wst.sse.core/format" value="false"/> <mapEntry key="org.eclipse.ocl/debug/evaluation" value="false"/> <mapEntry key="org.eclipse.ui/trace/operations.verbose" value="false"/> <mapEntry key="org.eclipse.emf.validation/debug/constraints" value="false"/> <mapEntry key="org.eclipse.osgi/trace/activation" value="false"/> <mapEntry key="org.eclipse.ocl/debug/exceptions/catching" value="false"/> <mapEntry key="org.eclipse.debug.core/debug/commands" value="false"/> -<mapEntry key="org.eclipse.team.core/threading" value="false"/> <mapEntry key="org.eclipse.ui/perf/workbench.restore" value="30000"/> +<mapEntry key="org.eclipse.team.core/threading" value="false"/> <mapEntry key="org.eclipse.wst.sse.core/structureddocument" value="false"/> <mapEntry key="org.eclipse.net4j.util/perf" value="false"/> <mapEntry key="org.eclipse.emf.transaction/debug/methods/exiting" value="false"/> <mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> <mapEntry key="org.eclipse.emf.cdo.protocol/debug.protocol" value="true"/> +<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> <mapEntry key="org.eclipse.ocl/debug" value="true"/> <mapEntry key="org.eclipse.ui/trace/graphics" value="false"/> <mapEntry key="org.eclipse.osgi/defaultprofile/logsynchronously" value="false"/> <mapEntry key="org.eclipse.net4j.db/debug" value="true"/> -<mapEntry key="org.eclipse.wst.common.environment/trace/ws_dt_cmd_engine" value="true"/> <mapEntry key="org.eclipse.emf.query/debug/exceptions/throwing" value="false"/> +<mapEntry key="org.eclipse.wst.common.environment/trace/ws_dt_cmd_engine" value="true"/> <mapEntry key="org.eclipse.osgi/monitor/activation" value="false"/> <mapEntry key="org.eclipse.net4j.jms/debug.protocol" value="true"/> <mapEntry key="org.eclipse.wst.sse.ui/gotoNextAnnotation" value="false"/> @@ -101,8 +101,8 @@ <mapEntry key="org.eclipse.debug.ui/debug" value="false"/> <mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/> <mapEntry key="org.eclipse.help.base/debug/search" value="false"/> -<mapEntry key="org.eclipse.pde.build/debug" value="false"/> <mapEntry key="org.eclipse.jface.text/debug/ContentAssistSubjectAdapters" value="false"/> +<mapEntry key="org.eclipse.pde.build/debug" value="false"/> <mapEntry key="org.eclipse.wst.common.environment/trace/ws_ant" value="true"/> <mapEntry key="org.eclipse.jdt.ui/perf/search/participants" value="300"/> <mapEntry key="org.eclipse.emf.validation/debug/parsers" value="false"/> @@ -111,13 +111,13 @@ <mapEntry key="org.eclipse.ui/perf/perspective.create" value="800"/> <mapEntry key="org.eclipse.update.core/debug/type" value="false"/> <mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/generics" value="false"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/> <mapEntry key="org.eclipse.emf.workspace/debug/methods/exiting" value="false"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/> +<mapEntry key="org.eclipse.osgi/resolver/generics" value="false"/> <mapEntry key="org.eclipse.wst.common.project.facet.core/actionSorting" value="false"/> <mapEntry key="org.eclipse.osgi/resolver/requires" value="false"/> -<mapEntry key="org.eclipse.core.resources/refresh" value="false"/> <mapEntry key="org.eclipse.emf.workspace/debug/exceptions/throwing" value="false"/> +<mapEntry key="org.eclipse.core.resources/refresh" value="false"/> <mapEntry key="org.eclipse.jdt.core/perf/containerinitializer" value="5000"/> <mapEntry key="org.eclipse.osgi/profile/benchmark" value="false"/> <mapEntry key="org.eclipse.help.webapp/debug" value="true"/> @@ -128,14 +128,14 @@ <mapEntry key="org.eclipse.ui/trace/handlers" value="false"/> <mapEntry key="org.eclipse.ui/trace/contexts.performance" value="false"/> <mapEntry key="org.eclipse.jem.util/debug/logtrace" value="false"/> -<mapEntry key="org.eclipse.jdt.core/perf/completion" value="300"/> <mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/> +<mapEntry key="org.eclipse.jdt.core/perf/completion" value="300"/> <mapEntry key="org.eclipse.osgi/profile/startup" value="false"/> <mapEntry key="org.eclipse.core.jobs/jobs" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/debug" value="true"/> -<mapEntry key="org.eclipse.wst.common.environment/trace/info" value="true"/> -<mapEntry key="org.eclipse.emf.query.ocl/debug/exceptions/throwing" value="false"/> <mapEntry key="org.eclipse.core.resources/perf/save.participants" value="500"/> +<mapEntry key="org.eclipse.emf.query.ocl/debug/exceptions/throwing" value="false"/> +<mapEntry key="org.eclipse.wst.common.environment/trace/info" value="true"/> <mapEntry key="org.eclipse.net4j/perf" value="false"/> <mapEntry key="org.eclipse.help.base/debug" value="true"/> <mapEntry key="org.eclipse.net4j/debug" value="true"/> @@ -153,11 +153,11 @@ <mapEntry key="org.eclipse.core.resources/contenttype/cache" value="false"/> <mapEntry key="org.eclipse.emf.cdo/debug.repository" value="true"/> <mapEntry key="org.eclipse.wst.sse.ui/extendedconfigurationbuilder" value="false"/> -<mapEntry key="org.eclipse.core.jobs/jobs/locks" value="false"/> <mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/> +<mapEntry key="org.eclipse.core.jobs/jobs/locks" value="false"/> <mapEntry key="org.eclipse.wst.xml.core/debug/cmdocumentmanager" value="false"/> -<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> <mapEntry key="org.eclipse.ui/trace/handlers.verbose.commandId" value=""/> +<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> <mapEntry key="org.eclipse.ui.ide/debug" value="false"/> <mapEntry key="org.eclipse.osgi/profile/debug" value="false"/> <mapEntry key="org.eclipse.pde.core/debug" value="true"/> @@ -166,17 +166,17 @@ <mapEntry key="org.eclipse.net4j.util/debug.registry" value="true"/> <mapEntry key="org.eclipse.jdt.ui/perf/explorer/createPartControl" value="1300"/> <mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/> -<mapEntry key="org.eclipse.ui.ide/debug/internalerror/openDialog" value="false"/> -<mapEntry key="org.eclipse.emf.cdo/debug.object" value="false"/> <mapEntry key="org.eclipse.jdt.core/perf/variableinitializer" value="5000"/> +<mapEntry key="org.eclipse.emf.cdo/debug.object" value="false"/> +<mapEntry key="org.eclipse.ui.ide/debug/internalerror/openDialog" value="false"/> <mapEntry key="org.eclipse.emf.cdo.server/debug.revision" value="true"/> <mapEntry key="org.eclipse.core.resources/strings" value="false"/> <mapEntry key="org.eclipse.jdt.core/debug/sourcemapper" value="false"/> <mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/> <mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/> -<mapEntry key="org.eclipse.ui/perf/showHeapStatus" value="true"/> -<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/> <mapEntry key="org.eclipse.core.resources/preferences" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/> +<mapEntry key="org.eclipse.ui/perf/showHeapStatus" value="true"/> <mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/> <mapEntry key="org.eclipse.emf.workspace/debug" value="true"/> <mapEntry key="org.eclipse.jdt.ui/perf/content_assist_sorters/extensions" value=""/> @@ -190,25 +190,25 @@ <mapEntry key="org.eclipse.emf.transaction/debug/transactions" value="false"/> <mapEntry key="org.eclipse.ocl/debug/parsing" value="false"/> <mapEntry key="org.eclipse.update.core/debug" value="true"/> -<mapEntry key="org.eclipse.wst.sse.core/tasks/preferences" value="false"/> <mapEntry key="org.eclipse.osgi/debug/security" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/> +<mapEntry key="org.eclipse.wst.sse.core/tasks/preferences" value="false"/> <mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/> <mapEntry key="org.eclipse.core.resources/perf/builders" value="10000"/> -<mapEntry key="org.eclipse.net4j.jms.admin/debug.protocol" value="true"/> <mapEntry key="org.eclipse.ui/perf/perspective.listeners" value="200"/> +<mapEntry key="org.eclipse.net4j.jms.admin/debug.protocol" value="true"/> <mapEntry key="org.eclipse.ui/debug/showAllJobs" value="false"/> <mapEntry key="org.eclipse.core.resources/history" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem" value="false"/> <mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener" value="false"/> <mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/> -<mapEntry key="org.eclipse.pde.core/validation" value="false"/> <mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/> +<mapEntry key="org.eclipse.pde.core/validation" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/readtime" value="false"/> <mapEntry key="org.eclipse.jface.text/debug/AnnotationPainter" value="false"/> <mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/> -<mapEntry key="org.eclipse.core.runtime/debug" value="false"/> <mapEntry key="org.eclipse.wst.sse.core/tasks" value="false"/> +<mapEntry key="org.eclipse.core.runtime/debug" value="false"/> <mapEntry key="org.eclipse.equinox.preferences/set" value="false"/> <mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/> <mapEntry key="org.eclipse.ui/perf/perspective.switch" value="800"/> @@ -221,16 +221,16 @@ <mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/> <mapEntry key="org.eclipse.core.runtime/perf/success" value="false"/> <mapEntry key="org.eclipse.net4j/debug.connector" value="true"/> -<mapEntry key="org.eclipse.jdt.core/perf/selection" value="300"/> <mapEntry key="org.eclipse.wst.dtd.ui/projectionperf" value="false"/> +<mapEntry key="org.eclipse.jdt.core/perf/selection" value="300"/> <mapEntry key="org.eclipse.osgi/debug/startlevel" value="false"/> <mapEntry key="org.eclipse.ocl/debug/methods/entering" value="false"/> <mapEntry key="org.eclipse.core.resources/restore" value="false"/> <mapEntry key="org.eclipse.osgi/resolver/wiring" value="false"/> <mapEntry key="org.eclipse.core.resources/perf/snapshot" value="1000"/> <mapEntry key="org.eclipse.ui.intro/trace/logPerformance" value="false"/> -<mapEntry key="org.eclipse.osgi/debug/loader" value="false"/> <mapEntry key="org.eclipse.ui/trace/contexts.verbose" value="false"/> +<mapEntry key="org.eclipse.osgi/debug/loader" value="false"/> <mapEntry key="org.eclipse.osgi/resolver/grouping" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/debug/reconcilerjob" value="false"/> <mapEntry key="org.eclipse.jdt.ui/perf/explorer/makeActions" value="1000"/> @@ -246,11 +246,11 @@ <mapEntry key="org.eclipse.emf.validation/debug/cache" value="false"/> <mapEntry key="org.eclipse.update.core/debug/install" value="false"/> <mapEntry key="org.eclipse.equinox.registry/debug/events" value="false"/> -<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> <mapEntry key="org.eclipse.help/debug/protocols" value="false"/> +<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> <mapEntry key="org.eclipse.net4j.util/debug.lifecycle" value="true"/> -<mapEntry key="org.eclipse.ui/perf/contentTypes" value="200"/> <mapEntry key="org.eclipse.emf.validation/debug/methods/entering" value="false"/> +<mapEntry key="org.eclipse.ui/perf/contentTypes" value="200"/> <mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser/inprocess" value="false"/> <mapEntry key="org.eclipse.jdt.core/perf/javadeltalistener" value="500"/> <mapEntry key="org.eclipse.core.resources/perf/listeners" value="500"/> @@ -264,8 +264,8 @@ <mapEntry key="org.eclipse.wst.sse.ui/debug/reconcilerValidators" value="false"/> <mapEntry key="org.eclipse.emf.validation/debug/xml" value="false"/> <mapEntry key="org.eclipse.osgi/debug/manifest" value="false"/> -<mapEntry key="org.eclipse.emf.cdo/debug" value="true"/> <mapEntry key="org.eclipse.ui/trace/multipageeditor" value="false"/> +<mapEntry key="org.eclipse.emf.cdo/debug" value="true"/> <mapEntry key="org.eclipse.emf.cdo.ui/debug" value="true"/> <mapEntry key="org.eclipse.emf.workspace/debug/exceptions/catching" value="false"/> <mapEntry key="org.eclipse.core.resources/build/needbuildstack" value="false"/> @@ -281,23 +281,23 @@ <mapEntry key="org.eclipse.osgi/trace/classLoading" value="false"/> <mapEntry key="org.eclipse.net4j.jms.server.jdbc/debug" value="true"/> <mapEntry key="org.eclipse.wst.xml.ui/projectionperf" value="false"/> -<mapEntry key="org.eclipse.core.resources/save" value="false"/> <mapEntry key="org.eclipse.core.jobs/jobs/errorondeadlock" value="false"/> +<mapEntry key="org.eclipse.core.resources/save" value="false"/> <mapEntry key="org.eclipse.emf.transaction/debug/exceptions/throwing" value="false"/> <mapEntry key="org.eclipse.core.resources/contenttype" value="false"/> -<mapEntry key="org.eclipse.jface.text/debug/FastPartitioner/PositionCache" value="false"/> <mapEntry key="org.eclipse.jem.util/debug/loglevel" value="WARNING"/> +<mapEntry key="org.eclipse.jface.text/debug/FastPartitioner/PositionCache" value="false"/> <mapEntry key="org.eclipse.emf.validation/debug/exceptions/catching" value="false"/> -<mapEntry key="org.eclipse.emf.cdo.server/debug" value="true"/> <mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/> +<mapEntry key="org.eclipse.emf.cdo.server/debug" value="true"/> <mapEntry key="org.eclipse.osgi/debug/events" value="false"/> <mapEntry key="org.eclipse.ui/trace/commands" value="false"/> <mapEntry key="org.eclipse.equinox.preferences/get" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/filemodelprovider/operations" value="false"/> <mapEntry key="org.eclipse.jdt.ui/debug/ResultCollector" value="false"/> <mapEntry key="org.eclipse.debug.ui/debug/launchhistory" value="false"/> -<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime" value="false"/> <mapEntry key="org.eclipse.net4j.util/debug.om" value="true"/> +<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime" value="false"/> <mapEntry key="org.eclipse.net4j.jms.server/debug" value="true"/> <mapEntry key="org.eclipse.emf.workspace/debug/methods/entering" value="false"/> <mapEntry key="org.eclipse.emf.query.ocl/debug/methods/entering" value="false"/> @@ -309,8 +309,8 @@ <mapEntry key="org.eclipse.ui.intro/debug" value="true"/> <mapEntry key="org.eclipse.emf.transaction/debug/locking" value="false"/> <mapEntry key="org.eclipse.jdt.core/debug/cpresolution/advanced" value="false"/> -<mapEntry key="org.eclipse.emf.validation/debug/providers" value="false"/> <mapEntry key="org.eclipse.net4j.jms/debug" value="true"/> +<mapEntry key="org.eclipse.emf.validation/debug/providers" value="false"/> <mapEntry key="org.eclipse.osgi/eclipseadaptor/converter/debug" value="false"/> <mapEntry key="org.eclipse.emf.cdo.server/debug.resource" value="true"/> <mapEntry key="org.eclipse.pde.core/cache" value="false"/> @@ -318,16 +318,16 @@ <mapEntry key="org.eclipse.wst.sse.ui/extendedconfigurationbuilder/time" value="false"/> <mapEntry key="org.eclipse.wst.sse.core/tasks/time" value="false"/> <mapEntry key="org.eclipse.emf.cdo/debug.transaction" value="true"/> -<mapEntry key="org.eclipse.emf.query/debug/methods/exiting" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/filemodelprovider/lifecyclelistener" value="false"/> -<mapEntry key="org.eclipse.net4j/debug.selector" value="true"/> +<mapEntry key="org.eclipse.emf.query/debug/methods/exiting" value="false"/> <mapEntry key="org.eclipse.debug.core/debug/events" value="false"/> +<mapEntry key="org.eclipse.net4j/debug.selector" value="true"/> <mapEntry key="org.eclipse.jdt.ui/debug" value="true"/> -<mapEntry key="org.eclipse.osgi/monitor/classes" value="false"/> -<mapEntry key="org.eclipse.wst.sse.core/filebuffers/modelmanagement" value="false"/> <mapEntry key="org.eclipse.net4j.db/debug.sql" value="true"/> -<mapEntry key="org.eclipse.wst.sse.ui/debug/tracefilter" value=""/> +<mapEntry key="org.eclipse.wst.sse.core/filebuffers/modelmanagement" value="false"/> +<mapEntry key="org.eclipse.osgi/monitor/classes" value="false"/> <mapEntry key="org.eclipse.ui/perf/part.input" value="200"/> +<mapEntry key="org.eclipse.wst.sse.ui/debug/tracefilter" value=""/> <mapEntry key="org.eclipse.wtp.common/debug/logtracefile" value="false"/> <mapEntry key="org.eclipse.emf.query/debug" value="true"/> <mapEntry key="org.eclipse.ui.intro.universal/debug" value="true"/> @@ -343,11 +343,11 @@ <mapEntry key="org.eclipse.jdt.core.manipulation/debug" value="true"/> <mapEntry key="org.eclipse.net4j.jms.admin/debug" value="true"/> <mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/> -<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser" value="false"/> <mapEntry key="org.eclipse.wst.common.project.facet.core/activation" value="false"/> +<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser" value="false"/> <mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/> -<mapEntry key="org.eclipse.ui/perf/part.create" value="800"/> <mapEntry key="org.eclipse.core.resources/build/stacktrace" value="false"/> +<mapEntry key="org.eclipse.ui/perf/part.create" value="800"/> <mapEntry key="org.eclipse.ui.intro/trace/logInfo" value="true"/> <mapEntry key="org.eclipse.team.core/streams" value="false"/> <mapEntry key="org.eclipse.ui.ide/debug/undomonitor" value="false"/> @@ -355,11 +355,11 @@ <mapEntry key="org.eclipse.ui/experimental/menus" value="false"/> <mapEntry key="org.eclipse.core.jobs/jobs/shutdown" value="false"/> <mapEntry key="org.eclipse.osgi/debug/packageadmin" value="false"/> -<mapEntry key="org.eclipse.emf.cdo/debug.session" value="true"/> <mapEntry key="org.eclipse.net4j.container.ui/debug" value="true"/> +<mapEntry key="org.eclipse.emf.cdo/debug.session" value="true"/> <mapEntry key="org.eclipse.core.runtime/compatibility/debug" value="false"/> -<mapEntry key="org.eclipse.wst.sse.ui/storagemodelprovider/operations" value="false"/> <mapEntry key="org.eclipse.emf.cdo/debug.adapter" value="true"/> +<mapEntry key="org.eclipse.wst.sse.ui/storagemodelprovider/operations" value="false"/> <mapEntry key="org.eclipse.ui/debug/declaredImages" value="false"/> <mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/> <mapEntry key="org.eclipse.ui.ide/debug/gc" value="false"/> @@ -369,36 +369,36 @@ <mapEntry key="org.eclipse.net4j.db.mysql/debug.sql" value="true"/> <mapEntry key="org.eclipse.ui.workbench/debug" value="false"/> <mapEntry key="org.eclipse.jdt.ui/perf/content_assist/extensions" value="1000"/> -<mapEntry key="org.eclipse.emf.cdo.protocol/debug.model" value="true"/> <mapEntry key="org.eclipse.osgi/debug/filter" value="false"/> +<mapEntry key="org.eclipse.emf.cdo.protocol/debug.model" value="true"/> <mapEntry key="org.eclipse.debug.core/debug" value="false"/> <mapEntry key="org.eclipse.core.resources/debug" value="false"/> <mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/> <mapEntry key="org.eclipse.jem.util/debug/logtracefile" value="false"/> <mapEntry key="org.eclipse.ui.browser/debug" value="false"/> <mapEntry key="org.eclipse.osgi/profile/impl" value="org.eclipse.osgi.internal.profile.DefaultProfileLogger"/> -<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> <mapEntry key="org.eclipse.net4j.jms.server/debug.protocol" value="true"/> +<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> <mapEntry key="org.eclipse.team.cvs.core/debug" value="false"/> <mapEntry key="org.eclipse.help/debug" value="true"/> <mapEntry key="org.eclipse.core.runtime/perf" value="false"/> <mapEntry key="org.eclipse.osgi/trace/filters" value="trace.properties"/> -<mapEntry key="org.eclipse.wst.sse.core/dom/adapter/notification/time" value="false"/> <mapEntry key="org.eclipse.emf.ocl/debug/methods/entering" value="false"/> +<mapEntry key="org.eclipse.wst.sse.core/dom/adapter/notification/time" value="false"/> <mapEntry key="org.eclipse.net4j/debug.channel" value="true"/> <mapEntry key="org.eclipse.emf.cdo/debug.revision" value="true"/> <mapEntry key="org.eclipse.emf.cdo/debug.view" value="true"/> <mapEntry key="org.eclipse.ui/perf/part.listeners" value="200"/> <mapEntry key="org.eclipse.debug.ui/debug/viewers/viewer" value="false"/> -<mapEntry key="org.eclipse.ui/trace/keyBindings.verbose" value="false"/> <mapEntry key="org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria" value="10"/> +<mapEntry key="org.eclipse.ui/trace/keyBindings.verbose" value="false"/> <mapEntry key="org.eclipse.wst.common.environment/trace/data" value="true"/> -<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> <mapEntry key="org.eclipse.osgi/defaultprofile/buffersize" value="256"/> -<mapEntry key="org.eclipse.ui/perf/page.listeners" value="200"/> +<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> <mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/> -<mapEntry key="org.eclipse.emf.cdo.protocol/debug" value="true"/> +<mapEntry key="org.eclipse.ui/perf/page.listeners" value="200"/> <mapEntry key="org.eclipse.ocl/debug/exceptions/throwing" value="false"/> +<mapEntry key="org.eclipse.emf.cdo.protocol/debug" value="true"/> <mapEntry key="org.eclipse.emf.cdo/debug.resource" value="true"/> <mapEntry key="org.eclipse.wst.sse.core/debug" value="true"/> <mapEntry key="org.eclipse.ui/trace/handlers.verbose" value="false"/> @@ -418,16 +418,16 @@ <mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/> <mapEntry key="org.eclipse.osgi/resolver/cycles" value="false"/> <mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener" value="false"/> -<mapEntry key="org.eclipse.wst.sse.core/structuredmodel/locks" value="true"/> <mapEntry key="org.eclipse.wst.sse.core/filebuffers/lifecycle" value="false"/> +<mapEntry key="org.eclipse.wst.sse.core/structuredmodel/locks" value="true"/> <mapEntry key="org.eclipse.jdt.core/debug/resolution" value="false"/> <mapEntry key="org.eclipse.wst.common.environment/debug" value="true"/> <mapEntry key="org.eclipse.update.configurator/debug" value="false"/> -<mapEntry key="org.eclipse.debug.ui/debug/viewers/deltas" value="false"/> <mapEntry key="org.eclipse.help.ui/debug" value="true"/> +<mapEntry key="org.eclipse.debug.ui/debug/viewers/deltas" value="false"/> <mapEntry key="org.eclipse.emf.query.ocl/debug/methods/exiting" value="false"/> -<mapEntry key="org.eclipse.ocl/debug/methods/exiting" value="false"/> <mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/location" value="false"/> +<mapEntry key="org.eclipse.ocl/debug/methods/exiting" value="false"/> <mapEntry key="org.eclipse.wst.sse.ui/debug/reconcilerSpelling" value="false"/> <mapEntry key="org.eclipse.emf.transaction/debug/methods/entering" value="false"/> <mapEntry key="org.eclipse.ui.intro.universal/trace/logInfo" value="true"/> diff --git a/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/mysql/DerbyAdapter.java b/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/mysql/DerbyAdapter.java index 8c66f51..1f3cb46 100644 --- a/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/mysql/DerbyAdapter.java +++ b/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/internal/mysql/DerbyAdapter.java @@ -10,7 +10,7 @@ **************************************************************************/ package org.eclipse.net4j.db.internal.mysql; -import org.eclipse.net4j.internal.db.AbstractDBAdapter; +import org.eclipse.net4j.internal.db.DBAdapter; import org.apache.derby.jdbc.EmbeddedDriver; @@ -19,7 +19,7 @@ import java.sql.Driver; /** * @author Eike Stepper */ -public class DerbyAdapter extends AbstractDBAdapter +public class DerbyAdapter extends DBAdapter { public DerbyAdapter() { diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java index ce4a704..f799a4a 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java @@ -10,7 +10,7 @@ **************************************************************************/ package org.eclipse.net4j.db; -import org.eclipse.net4j.internal.db.Schema; +import org.eclipse.net4j.internal.db.DBSchema; import org.eclipse.net4j.internal.db.bundle.OM; import org.eclipse.net4j.util.ReflectUtil; @@ -27,9 +27,9 @@ public final class DBUtil { } - public static ISchema createSchema(String name) + public static IDBSchema createSchema(String name) { - return new Schema(name); + return new DBSchema(name); } public static DataSource createDataSource(Map<Object, Object> properties) diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java index b3ffba0..0fd3ce7 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java @@ -11,7 +11,7 @@ package org.eclipse.net4j.db; import org.eclipse.net4j.internal.db.DBAdapterRegistry; -import org.eclipse.net4j.internal.db.Table; +import org.eclipse.net4j.internal.db.DBTable; import org.eclipse.net4j.util.registry.IRegistry; import java.sql.Driver; @@ -30,5 +30,5 @@ public interface IDBAdapter public Driver getJDBCDriver(); - public void createTable(Table table, Statement statement); + public void createTable(DBTable table, Statement statement); } diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IField.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBField.java index d644e6c..ba001fa 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IField.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBField.java @@ -13,11 +13,11 @@ package org.eclipse.net4j.db; /** * @author Eike Stepper */ -public interface IField +public interface IDBField { public static final int DEFAULT = -1; - public ITable geTable(); + public IDBTable geTable(); public String getName(); diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IIndex.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBIndex.java index 6347ff7..c9ed339 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IIndex.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBIndex.java @@ -13,17 +13,17 @@ package org.eclipse.net4j.db; /** * @author Eike Stepper */ -public interface IIndex +public interface IDBIndex { - public ITable geTable(); + public IDBTable geTable(); public Type geType(); - public IField getField(int index); + public IDBField getField(int index); public int getFieldCount(); - public IField[] getFields(); + public IDBField[] getFields(); public int getPosition(); diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ISchema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBSchema.java index 36515c8..09466b3 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ISchema.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBSchema.java @@ -15,15 +15,15 @@ import javax.sql.DataSource; /** * @author Eike Stepper */ -public interface ISchema +public interface IDBSchema { public String getName(); - public ITable addTable(String name); + public IDBTable addTable(String name); - public ITable getTable(String name); + public IDBTable getTable(String name); - public ITable[] getTables(); + public IDBTable[] getTables(); public void create(IDBAdapter dbAdapter, DataSource dataSource); } diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBStoreManager.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBStoreManager.java new file mode 100644 index 0000000..57cc73e --- /dev/null +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBStoreManager.java @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.db; + +import org.eclipse.net4j.util.store.IStoreManager; + +import javax.sql.DataSource; + +import java.sql.Connection; + +/** + * @author Eike Stepper + */ +public interface IDBStoreManager<TRANSACTION extends IDBStoreTransaction> extends IStoreManager<TRANSACTION> +{ + public static final String STORE_TYPE = "JDBC"; + + public IDBAdapter getDBAdapter(); + + public DataSource getDataSource(); + + public Connection getConnection(); + + public void initDatabase(); +} diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreManager.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBStoreTransaction.java index 2032c41..f3b36d8 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreManager.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBStoreTransaction.java @@ -8,21 +8,16 @@ * Contributors: * Eike Stepper - initial API and implementation **************************************************************************/ -package org.eclipse.emf.cdo.server; +package org.eclipse.net4j.db; + +import org.eclipse.net4j.util.store.IStoreTransaction; + +import java.sql.Connection; /** * @author Eike Stepper */ -public interface IStoreManager +public interface IDBStoreTransaction extends IStoreTransaction { - public String getStoreType(); - - public String getInstanceID(); - - public IStoreTransaction startTransaction(); - - public void commitTransaction(IStoreTransaction transaction); - - public void rollbackTransaction(IStoreTransaction transaction); - -} + public Connection getConnection(); +}
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBTable.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBTable.java new file mode 100644 index 0000000..71e626e --- /dev/null +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBTable.java @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.db; + +import org.eclipse.net4j.internal.db.DBField; + +/** + * @author Eike Stepper + */ +public interface IDBTable +{ + public IDBSchema getSchema(); + + public String getName(); + + public IDBField addField(String name, IDBField.Type type); + + public DBField addField(String name, IDBField.Type type, boolean notNull); + + public DBField addField(String name, IDBField.Type type, int precision); + + public DBField addField(String name, IDBField.Type type, int precision, boolean notNull); + + public DBField addField(String name, IDBField.Type type, int precision, int scale); + + public DBField addField(String name, IDBField.Type type, int precision, int scale, boolean notNull); + + public IDBField getField(String name); + + public IDBField getField(int index); + + public int getFieldCount(); + + public IDBField[] getFields(); + + public IDBIndex addIndex(IDBIndex.Type type, IDBField field); + + public IDBIndex addIndex(IDBIndex.Type type, IDBField[] fields); + + public int getIndexCount(); + + public IDBIndex[] getIndices(); + + public IDBIndex getPrimaryKeyIndex(); +} diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ITable.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ITable.java deleted file mode 100644 index 221b192..0000000 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ITable.java +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2004 - 2007 Eike Stepper, Germany. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Eike Stepper - initial API and implementation - **************************************************************************/ -package org.eclipse.net4j.db; - -import org.eclipse.net4j.internal.db.Field; - -/** - * @author Eike Stepper - */ -public interface ITable -{ - public ISchema getSchema(); - - public String getName(); - - public IField addField(String name, IField.Type type); - - public Field addField(String name, IField.Type type, boolean notNull); - - public Field addField(String name, IField.Type type, int precision); - - public Field addField(String name, IField.Type type, int precision, boolean notNull); - - public Field addField(String name, IField.Type type, int precision, int scale); - - public Field addField(String name, IField.Type type, int precision, int scale, boolean notNull); - - public IField getField(String name); - - public IField getField(int index); - - public int getFieldCount(); - - public IField[] getFields(); - - public IIndex addIndex(IIndex.Type type, IField field); - - public IIndex addIndex(IIndex.Type type, IField[] fields); - - public int getIndexCount(); - - public IIndex[] getIndices(); - - public IIndex getPrimaryKeyIndex(); -} diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/AbstractDBAdapter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBAdapter.java index 552e77f..647a0af 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/AbstractDBAdapter.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBAdapter.java @@ -12,7 +12,7 @@ package org.eclipse.net4j.internal.db; import org.eclipse.net4j.db.DBException; import org.eclipse.net4j.db.IDBAdapter; -import org.eclipse.net4j.db.IField.Type; +import org.eclipse.net4j.db.IDBField.Type; import java.sql.ResultSet; import java.sql.ResultSetMetaData; @@ -22,13 +22,13 @@ import java.sql.Statement; /** * @author Eike Stepper */ -public abstract class AbstractDBAdapter implements IDBAdapter +public abstract class DBAdapter implements IDBAdapter { private String name; private String version; - public AbstractDBAdapter(String name, String version) + public DBAdapter(String name, String version) { this.name = name; this.version = version; @@ -44,7 +44,7 @@ public abstract class AbstractDBAdapter implements IDBAdapter return version; } - public void createTable(Table table, Statement statement) + public void createTable(DBTable table, Statement statement) { try { @@ -64,7 +64,7 @@ public abstract class AbstractDBAdapter implements IDBAdapter return getName() + "-" + getVersion(); } - protected void doCreateTable(Table table, Statement statement) throws SQLException + protected void doCreateTable(DBTable table, Statement statement) throws SQLException { StringBuilder builder = new StringBuilder(); builder.append("CREATE TABLE "); @@ -84,17 +84,17 @@ public abstract class AbstractDBAdapter implements IDBAdapter statement.execute(sql); } - protected String createConstraints(Table table) + protected String createConstraints(DBTable table) { return null; } - protected String createFieldDefinition(Field field) + protected String createFieldDefinition(DBField field) { return getTypeName(field) + (field.isNotNull() ? " NOT NULL" : ""); } - protected String getTypeName(Field field) + protected String getTypeName(DBField field) { Type type = field.getType(); switch (type) @@ -131,7 +131,7 @@ public abstract class AbstractDBAdapter implements IDBAdapter throw new IllegalArgumentException("Unknown type: " + type); } - protected void validateTable(Table table, Statement statement) + protected void validateTable(DBTable table, Statement statement) { try { @@ -147,18 +147,18 @@ public abstract class AbstractDBAdapter implements IDBAdapter int columnCount = metaData.getColumnCount(); if (columnCount != table.getFieldCount()) { - throw new DBException("Table " + table.getName() + " has " + columnCount + " columns instead of " + throw new DBException("DBTable " + table.getName() + " has " + columnCount + " columns instead of " + table.getFieldCount()); } for (int i = 0; i < columnCount; i++) { int existingCode = metaData.getColumnType(i + 1); - Field field = table.getField(i); + DBField field = table.getField(i); int code = field.getType().getCode(); if (code != existingCode) { - throw new DBException("Field " + field.getFullName() + " has type " + existingCode + " instead of " + code + throw new DBException("DBField " + field.getFullName() + " has type " + existingCode + " instead of " + code + " (" + field.getType() + ")"); } } @@ -169,15 +169,15 @@ public abstract class AbstractDBAdapter implements IDBAdapter } } - private String[] createFieldDefinitions(Table table) + private String[] createFieldDefinitions(DBTable table) { - Field[] fields = table.getFields(); + DBField[] fields = table.getFields(); int fieldCount = fields.length; String[] result = new String[fieldCount]; for (int i = 0; i < fieldCount; i++) { - Field field = fields[i]; + DBField field = fields[i]; result[i] = createFieldDefinition(field); } diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Field.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBField.java index 461d41c..8d09d7c 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Field.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBField.java @@ -10,16 +10,16 @@ **************************************************************************/ package org.eclipse.net4j.internal.db; -import org.eclipse.net4j.db.IField; +import org.eclipse.net4j.db.IDBField; /** * @author Eike Stepper */ -public class Field implements IField +public class DBField implements IDBField { private static final int DEFAULT_PRECISION = 255; - private Table table; + private DBTable table; private String name; @@ -33,7 +33,7 @@ public class Field implements IField private int position; - public Field(Table table, String name, Type type, int precision, int scale, boolean notNull, int position) + public DBField(DBTable table, String name, Type type, int precision, int scale, boolean notNull, int position) { this.table = table; this.name = name; @@ -44,7 +44,7 @@ public class Field implements IField this.position = position; } - public Table geTable() + public DBTable geTable() { return table; } diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Index.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBIndex.java index a950e60..6a6b3cb 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Index.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBIndex.java @@ -10,23 +10,23 @@ **************************************************************************/ package org.eclipse.net4j.internal.db; -import org.eclipse.net4j.db.IField; -import org.eclipse.net4j.db.IIndex; +import org.eclipse.net4j.db.IDBField; +import org.eclipse.net4j.db.IDBIndex; /** * @author Eike Stepper */ -public class Index implements IIndex +public class DBIndex implements IDBIndex { - private Table table; + private DBTable table; private Type type; - private IField[] fields; + private IDBField[] fields; public int position; - public Index(Table table, Type type, IField[] fields, int position) + public DBIndex(DBTable table, Type type, IDBField[] fields, int position) { this.table = table; this.type = type; @@ -34,7 +34,7 @@ public class Index implements IIndex this.position = position; } - public Table geTable() + public DBTable geTable() { return table; } @@ -44,7 +44,7 @@ public class Index implements IIndex return type; } - public IField getField(int index) + public IDBField getField(int index) { return fields[index]; } @@ -54,7 +54,7 @@ public class Index implements IIndex return fields.length; } - public IField[] getFields() + public IDBField[] getFields() { return fields; } diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Schema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBSchema.java index 04bd7df..5ecabe3 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Schema.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBSchema.java @@ -12,7 +12,7 @@ package org.eclipse.net4j.internal.db; import org.eclipse.net4j.db.DBException; import org.eclipse.net4j.db.IDBAdapter; -import org.eclipse.net4j.db.ISchema; +import org.eclipse.net4j.db.IDBSchema; import javax.sql.DataSource; @@ -25,15 +25,15 @@ import java.util.Map; /** * @author Eike Stepper */ -public class Schema implements ISchema +public class DBSchema implements IDBSchema { private String name; - private Map<String, Table> tables = new HashMap(); + private Map<String, DBTable> tables = new HashMap(); private boolean locked; - public Schema(String name) + public DBSchema(String name) { this.name = name; } @@ -43,27 +43,27 @@ public class Schema implements ISchema return name; } - public Table addTable(String name) + public DBTable addTable(String name) { assertUnlocked(); if (tables.containsKey(name)) { - throw new IllegalStateException("Table exists: " + name); + throw new IllegalStateException("DBTable exists: " + name); } - Table table = new Table(this, name); + DBTable table = new DBTable(this, name); tables.put(name, table); return table; } - public Table getTable(String name) + public DBTable getTable(String name) { return tables.get(name); } - public Table[] getTables() + public DBTable[] getTables() { - return tables.values().toArray(new Table[tables.size()]); + return tables.values().toArray(new DBTable[tables.size()]); } public boolean isLocked() @@ -82,7 +82,7 @@ public class Schema implements ISchema { Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement(); - for (Table table : tables.values()) + for (DBTable table : tables.values()) { dbAdapter.createTable(table, statement); } @@ -103,7 +103,7 @@ public class Schema implements ISchema { if (locked) { - throw new IllegalStateException("Schema locked: " + name); + throw new IllegalStateException("DBSchema locked: " + name); } } } diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBStoreManager.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBStoreManager.java new file mode 100644 index 0000000..92c2f99 --- /dev/null +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBStoreManager.java @@ -0,0 +1,145 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.internal.db; + +import org.eclipse.net4j.db.IDBAdapter; +import org.eclipse.net4j.db.IDBStoreManager; +import org.eclipse.net4j.db.IDBSchema; +import org.eclipse.net4j.internal.util.store.StoreManager; +import org.eclipse.net4j.util.store.StoreException; + +import javax.sql.DataSource; + +import java.sql.Connection; +import java.sql.SQLException; + +/** + * @author Eike Stepper + */ +public abstract class DBStoreManager<TRANSACTION extends DBStoreTransaction> extends StoreManager<TRANSACTION> + implements IDBStoreManager<TRANSACTION> +{ + private static final String STORE_TYPE = "JDBC"; + + private IDBSchema schema; + + private IDBAdapter dbAdapter; + + private DataSource dataSource; + + public DBStoreManager(IDBSchema schema, IDBAdapter dbAdapter, DataSource dataSource) + { + super(STORE_TYPE); + if (dbAdapter == null) + { + throw new IllegalArgumentException("dbAdapter == null"); + } + + if (dataSource == null) + { + throw new IllegalArgumentException("dataSource == null"); + } + + this.schema = schema; + this.dbAdapter = dbAdapter; + this.dataSource = dataSource; + } + + public IDBSchema getSchema() + { + return schema; + } + + public IDBAdapter getDBAdapter() + { + return dbAdapter; + } + + public DataSource getDataSource() + { + return dataSource; + } + + public Connection getConnection() + { + try + { + return dataSource.getConnection(); + } + catch (SQLException ex) + { + throw new StoreException(ex); + } + } + + public void initDatabase() + { + schema.create(dbAdapter, dataSource); + } + + public TRANSACTION startTransaction() throws StoreException + { + try + { + Connection connection = getConnection(); + connection.setAutoCommit(false); + return createTransaction(connection); + } + catch (SQLException ex) + { + throw new StoreException(ex); + } + } + + public void commitTransaction(TRANSACTION transaction) throws StoreException + { + try + { + Connection connection = transaction.getConnection(); + connection.commit(); + } + catch (StoreException ex) + { + throw ex; + } + catch (Exception ex) + { + throw new StoreException(ex); + } + finally + { + transaction.dispose(); + } + } + + public void rollbackTransaction(TRANSACTION transaction) throws StoreException + { + try + { + Connection connection = transaction.getConnection(); + connection.rollback(); + } + catch (StoreException ex) + { + throw ex; + } + catch (Exception ex) + { + throw new StoreException(ex); + } + finally + { + transaction.dispose(); + } + } + + protected abstract TRANSACTION createTransaction(Connection connection); +} diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBStoreTransaction.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBStoreTransaction.java new file mode 100644 index 0000000..5109625 --- /dev/null +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBStoreTransaction.java @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.internal.db; + +import org.eclipse.net4j.db.IDBStoreTransaction; +import org.eclipse.net4j.internal.util.store.StoreTransaction; +import org.eclipse.net4j.util.store.IStoreManager; +import org.eclipse.net4j.util.store.IStoreTransaction; + +import java.sql.Connection; + +/** + * @author Eike Stepper + */ +public class DBStoreTransaction extends StoreTransaction implements IDBStoreTransaction +{ + private Connection connection; + + public DBStoreTransaction(IStoreManager<? extends IStoreTransaction> storeManager, Connection connection) + { + super(storeManager); + this.connection = connection; + } + + public Connection getConnection() + { + return connection; + } + + public void dispose() + { + connection = null; + } +}
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Table.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBTable.java index f119586..3c15211 100644 --- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/Table.java +++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DBTable.java @@ -10,10 +10,10 @@ **************************************************************************/ package org.eclipse.net4j.internal.db; -import org.eclipse.net4j.db.IField; -import org.eclipse.net4j.db.IIndex; -import org.eclipse.net4j.db.ITable; -import org.eclipse.net4j.db.IIndex.Type; +import org.eclipse.net4j.db.IDBField; +import org.eclipse.net4j.db.IDBIndex; +import org.eclipse.net4j.db.IDBTable; +import org.eclipse.net4j.db.IDBIndex.Type; import java.io.IOException; import java.util.ArrayList; @@ -22,23 +22,23 @@ import java.util.List; /** * @author Eike Stepper */ -public class Table implements ITable +public class DBTable implements IDBTable { - private Schema schema; + private DBSchema schema; private String name; - private List<Field> fields = new ArrayList(); + private List<DBField> fields = new ArrayList(); - private List<Index> indices = new ArrayList(); + private List<DBIndex> indices = new ArrayList(); - public Table(Schema schema, String name) + public DBTable(DBSchema schema, String name) { this.schema = schema; this.name = name; } - public Schema getSchema() + public DBSchema getSchema() { return schema; } @@ -48,47 +48,47 @@ public class Table implements ITable return name; } - public Field addField(String name, IField.Type type) + public DBField addField(String name, IDBField.Type type) { - return addField(name, type, IField.DEFAULT, IField.DEFAULT, false); + return addField(name, type, IDBField.DEFAULT, IDBField.DEFAULT, false); } - public Field addField(String name, IField.Type type, boolean notNull) + public DBField addField(String name, IDBField.Type type, boolean notNull) { - return addField(name, type, IField.DEFAULT, IField.DEFAULT, notNull); + return addField(name, type, IDBField.DEFAULT, IDBField.DEFAULT, notNull); } - public Field addField(String name, IField.Type type, int precision) + public DBField addField(String name, IDBField.Type type, int precision) { - return addField(name, type, precision, IField.DEFAULT, false); + return addField(name, type, precision, IDBField.DEFAULT, false); } - public Field addField(String name, IField.Type type, int precision, boolean notNull) + public DBField addField(String name, IDBField.Type type, int precision, boolean notNull) { - return addField(name, type, precision, IField.DEFAULT, notNull); + return addField(name, type, precision, IDBField.DEFAULT, notNull); } - public Field addField(String name, IField.Type type, int precision, int scale) + public DBField addField(String name, IDBField.Type type, int precision, int scale) { return addField(name, type, precision, scale, false); } - public Field addField(String name, IField.Type type, int precision, int scale, boolean notNull) + public DBField addField(String name, IDBField.Type type, int precision, int scale, boolean notNull) { schema.assertUnlocked(); if (getField(name) != null) { - throw new IllegalStateException("Field exists: " + name); + throw new IllegalStateException("DBField exists: " + name); } - Field field = new Field(this, name, type, precision, scale, notNull, fields.size()); + DBField field = new DBField(this, name, type, precision, scale, notNull, fields.size()); fields.add(field); return field; } - public Field getField(String name) + public DBField getField(String name) { - for (Field field : fields) + for (DBField field : fields) { if (name.equals(field.getName())) { @@ -99,7 +99,7 @@ public class Table implements ITable return null; } - public Field getField(int index) + public DBField getField(int index) { return fields.get(index); } @@ -109,21 +109,21 @@ public class Table implements ITable return fields.size(); } - public Field[] getFields() + public DBField[] getFields() { - return fields.toArray(new Field[fields.size()]); + return fields.toArray(new DBField[fields.size()]); } - public Index addIndex(Type type, IField field) + public DBIndex addIndex(Type type, IDBField field) { - IField[] fields = { field }; + IDBField[] fields = { field }; return addIndex(type, fields); } - public Index addIndex(Type type, IField[] fields) + public DBIndex addIndex(Type type, IDBField[] fields) { schema.assertUnlocked(); - Index index = new Index(this, type, fields, indices.size()); + DBIndex index = new DBIndex(this, type, fields, indices.size()); indices.add(index); return index; } @@ -133,16 +133,16 @@ public class Table implements ITable return indices.size(); } - public Index[] getIndices() + public DBIndex[] getIndices() { - return indices.toArray(new Index[indices.size()]); + return indices.toArray(new DBIndex[indices.size()]); } - public IIndex getPrimaryKeyIndex() + public IDBIndex getPrimaryKeyIndex() { - for (IIndex index : indices) + for (IDBIndex index : indices) { - if (index.geType() == IIndex.Type.PRIMARY_KEY) + if (index.geType() == IDBIndex.Type.PRIMARY_KEY) { return index; } @@ -156,7 +156,7 @@ public class Table implements ITable try { boolean first = true; - for (Field field : fields) + for (DBField field : fields) { if (first) { @@ -181,7 +181,7 @@ public class Table implements ITable { for (int i = 0; i < fields.size(); i++) { - Field field = fields.get(i); + DBField field = fields.get(i); if (i != 0) { appendable.append(", "); diff --git a/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java b/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java index ef2fa68..7ae2274 100644 --- a/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java +++ b/plugins/org.eclipse.net4j.jms.server.jdbc/src/org/eclipse/net4j/jms/server/internal/jdbc/JMSSchema.java @@ -10,48 +10,48 @@ **************************************************************************/ package org.eclipse.net4j.jms.server.internal.jdbc; -import org.eclipse.net4j.db.IField; -import org.eclipse.net4j.db.IIndex; -import org.eclipse.net4j.db.ITable; -import org.eclipse.net4j.internal.db.Schema; +import org.eclipse.net4j.db.IDBField; +import org.eclipse.net4j.db.IDBIndex; +import org.eclipse.net4j.db.IDBTable; +import org.eclipse.net4j.internal.db.DBSchema; /** * @author Eike Stepper */ -public class JMSSchema extends Schema +public class JMSSchema extends DBSchema { public static final JMSSchema INSTANCE = new JMSSchema(); /** - * Table Destinations + * DBTable Destinations */ - public static final ITable DESTINATIONS = INSTANCE.addTable("destinations"); + public static final IDBTable DESTINATIONS = INSTANCE.addTable("destinations"); - public static final IField DESTINATIONS_NAME = // - DESTINATIONS.addField("name", IField.Type.VARCHAR, 255); + public static final IDBField DESTINATIONS_NAME = // + DESTINATIONS.addField("name", IDBField.Type.VARCHAR, 255); - public static final IField DESTINATIONS_TYPE = // - DESTINATIONS.addField("type", IField.Type.INTEGER); + public static final IDBField DESTINATIONS_TYPE = // + DESTINATIONS.addField("type", IDBField.Type.INTEGER); - public static final IIndex INDEX_DESTINATIONS_PK = // - DESTINATIONS.addIndex(IIndex.Type.PRIMARY_KEY, DESTINATIONS_NAME); + public static final IDBIndex INDEX_DESTINATIONS_PK = // + DESTINATIONS.addIndex(IDBIndex.Type.PRIMARY_KEY, DESTINATIONS_NAME); /** - * Table Messages + * DBTable Messages */ - public static final ITable MESSAGES = INSTANCE.addTable("messages"); + public static final IDBTable MESSAGES = INSTANCE.addTable("messages"); - public static final IField MESSAGES_ID = // - MESSAGES.addField("id", IField.Type.VARCHAR); + public static final IDBField MESSAGES_ID = // + MESSAGES.addField("id", IDBField.Type.VARCHAR); - public static final IField MESSAGES_DESTINATION = // - MESSAGES.addField("destination", IField.Type.VARCHAR); + public static final IDBField MESSAGES_DESTINATION = // + MESSAGES.addField("destination", IDBField.Type.VARCHAR); - public static final IField MESSAGES_PRIORITY = // - MESSAGES.addField("priority", IField.Type.INTEGER); + public static final IDBField MESSAGES_PRIORITY = // + MESSAGES.addField("priority", IDBField.Type.INTEGER); - public static final IIndex INDEX_MESSAGES_PK = // - MESSAGES.addIndex(IIndex.Type.PRIMARY_KEY, MESSAGES_ID); + public static final IDBIndex INDEX_MESSAGES_PK = // + MESSAGES.addIndex(IDBIndex.Type.PRIMARY_KEY, MESSAGES_ID); /** * Queries diff --git a/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF index 46bbd30..179d434 100644 --- a/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF @@ -21,6 +21,7 @@ Export-Package: org.eclipse.net4j.internal.util;version="0.8.0", org.eclipse.net4j.internal.util.lifecycle;version="0.8.0", org.eclipse.net4j.internal.util.om;version="0.8.0", org.eclipse.net4j.internal.util.registry;version="0.8.0", + org.eclipse.net4j.internal.util.store;version="0.8.0", org.eclipse.net4j.util;version="0.8.0", org.eclipse.net4j.util.concurrent;version="0.8.0", org.eclipse.net4j.util.container;version="0.8.0", @@ -32,5 +33,6 @@ Export-Package: org.eclipse.net4j.internal.util;version="0.8.0", org.eclipse.net4j.util.om.log;version="0.8.0", org.eclipse.net4j.util.om.trace;version="0.8.0", org.eclipse.net4j.util.registry;version="0.8.0", + org.eclipse.net4j.util.store;version="0.8.0", org.eclipse.net4j.util.stream;version="0.8.0" Eclipse-LazyStart: true diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreManager.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/store/StoreManager.java index bdb7d71..f86effb 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreManager.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/store/StoreManager.java @@ -8,16 +8,18 @@ * Contributors: * Eike Stepper - initial API and implementation **************************************************************************/ -package org.eclipse.emf.cdo.internal.server; - -import org.eclipse.emf.cdo.server.IStoreManager; +package org.eclipse.net4j.internal.util.store; import org.eclipse.net4j.internal.util.lifecycle.Lifecycle; +import org.eclipse.net4j.util.store.IStoreManager; +import org.eclipse.net4j.util.store.IStoreTransaction; +import org.eclipse.net4j.util.store.StoreException; /** * @author Eike Stepper */ -public abstract class StoreManager extends Lifecycle implements IStoreManager +public abstract class StoreManager<TRANSACTION extends IStoreTransaction> extends Lifecycle implements + IStoreManager<TRANSACTION> { private String storeType; @@ -42,4 +44,24 @@ public abstract class StoreManager extends Lifecycle implements IStoreManager { this.instanceID = instanceID; } + + public void transact(TransactedOperation<TRANSACTION> operation) throws StoreException + { + TRANSACTION transaction = startTransaction(); + try + { + operation.run(transaction); + commitTransaction(transaction); + } + catch (StoreException ex) + { + rollbackTransaction(transaction); + throw ex; + } + catch (Exception ex) + { + rollbackTransaction(transaction); + throw new StoreException(ex); + } + } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreTransaction.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/store/StoreTransaction.java index 0f7fc43..b5c9150 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreTransaction.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/store/StoreTransaction.java @@ -8,24 +8,25 @@ * Contributors: * Eike Stepper - initial API and implementation **************************************************************************/ -package org.eclipse.emf.cdo.internal.server; +package org.eclipse.net4j.internal.util.store; -import org.eclipse.emf.cdo.server.IStoreTransaction; +import org.eclipse.net4j.util.store.IStoreManager; +import org.eclipse.net4j.util.store.IStoreTransaction; /** * @author Eike Stepper */ public abstract class StoreTransaction implements IStoreTransaction { - private StoreManager store; + private IStoreManager<? extends IStoreTransaction> storeManager; - public StoreTransaction(StoreManager store) + public StoreTransaction(IStoreManager<? extends IStoreTransaction> storeManager) { - this.store = store; + this.storeManager = storeManager; } - public StoreManager getStore() + public IStoreManager<? extends IStoreTransaction> getStoreManager() { - return store; + return storeManager; } }
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/store/IStoreManager.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/store/IStoreManager.java new file mode 100644 index 0000000..a72bfe2 --- /dev/null +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/store/IStoreManager.java @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2007 Eike Stepper, Germany. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.util.store; + +/** + * @author Eike Stepper + */ +public interface IStoreManager<TRANSACTION extends IStoreTransaction> +{ + public String getStoreType(); + + public String getInstanceID(); + + public TRANSACTION startTransaction() throws StoreException; + + public void commitTransaction(TRANSACTION transaction) throws StoreException; + + public void rollbackTransaction(TRANSACTION transaction) throws StoreException; + + public void transact(TransactedOperation<TRANSACTION> operation) throws StoreException; + + /** + * @author Eike Stepper + */ + public interface TransactedOperation<TRANSACTION extends IStoreTransaction> + { + public void run(TRANSACTION transaction) throws Exception; + } +} diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreTransaction.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/store/IStoreTransaction.java index eb96bea..5298b3f 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreTransaction.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/store/IStoreTransaction.java @@ -8,12 +8,12 @@ * Contributors: * Eike Stepper - initial API and implementation **************************************************************************/ -package org.eclipse.emf.cdo.server; +package org.eclipse.net4j.util.store; /** * @author Eike Stepper */ public interface IStoreTransaction { - + public IStoreManager<? extends IStoreTransaction> getStoreManager(); } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreException.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/store/StoreException.java index e295525..7640617 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreException.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/store/StoreException.java @@ -8,7 +8,7 @@ * Contributors: * Eike Stepper - initial API and implementation **************************************************************************/ -package org.eclipse.emf.cdo.internal.server; +package org.eclipse.net4j.util.store; /** * @author Eike Stepper |