From 2da2085ae02533cedd7cff6c3abe1af2c1b15625 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Wed, 23 Sep 2015 19:33:28 +0200 Subject: [PATCH] Bug 4202: Migrate also toaster to use mdsal project This only changes dependency feature omitted from Change 26079, perhaps Java edits are also needed to keep toaster working. Also, git has somehow enforced change of line endings everywhere. Change-Id: I810fba0ae7a55e123dd6f78ba23a7e77a7118b57 Signed-off-by: Vratko Polak --- features/mdsal/src/main/features/features.xml | 2 +- .../src/main/resources/bin/instance.bat | 320 ++++---- .../src/main/resources/bin/karaf.bat | 694 +++++++++--------- .../main/resources/controller/checkstyle.xml | 50 +- .../concepts/transform/Acceptor.java | 38 +- .../transform/AggregateTransformer.java | 44 +- .../CompositeClassBasedTransformer.java | 242 +++--- .../CompositeConditionalTransformer.java | 314 ++++---- .../transform/InputClassBasedTransformer.java | 76 +- .../transform/RuleBasedTransformer.java | 84 +-- .../SimpleConditionalTransformer.java | 76 +- .../concepts/transform/Transformer.java | 54 +- .../liblldp/src/test/resources/log4j.xml | 40 +- opendaylight/md-sal/messagebus-config/pom.xml | 146 ++-- opendaylight/md-sal/messagebus-impl/pom.xml | 284 +++---- opendaylight/md-sal/messagebus-util/pom.xml | 118 +-- .../main/yang/opendaylight-md-sal-common.yang | 140 ++-- .../controller/sal/core/spi/BrokerModule.java | 54 +- .../sal/core/spi/data/package-info.java | 14 +- .../controller/sal/core/spi/package-info.java | 14 +- .../md-sal/sal-dom-xsql-config/pom.xml | 112 +-- opendaylight/md-sal/sal-karaf-xsql/pom.xml | 208 +++--- 22 files changed, 1562 insertions(+), 1562 deletions(-) diff --git a/features/mdsal/src/main/features/features.xml b/features/mdsal/src/main/features/features.xml index dfe39c4ed2..269eddd8aa 100644 --- a/features/mdsal/src/main/features/features.xml +++ b/features/mdsal/src/main/features/features.xml @@ -53,7 +53,7 @@ odl-yangtools-common - odl-yangtools-binding + odl-mdsal-binding-runtime odl-mdsal-broker mvn:org.opendaylight.controller.samples/sample-toaster/{{VERSION}} mvn:org.opendaylight.controller.samples/sample-toaster-consumer/{{VERSION}} diff --git a/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance.bat b/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance.bat index a9a5509836..9759d2d318 100644 --- a/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance.bat +++ b/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance.bat @@ -1,160 +1,160 @@ -@echo off -rem -rem -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. -rem - -if not "%ECHO%" == "" echo %ECHO% - -setlocal -set DIRNAME=%~dp0% -set PROGNAME=%~nx0% -set ARGS=%* - -rem Sourcing environment settings for karaf similar to tomcats setenv -SET KARAF_SCRIPT="instance.bat" -if exist "%DIRNAME%setenv.bat" ( - call "%DIRNAME%setenv.bat" -) - -rem Check console window title. Set to Karaf by default -if not "%KARAF_TITLE%" == "" ( - title %KARAF_TITLE% -) else ( - title Karaf -) - -rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage -if "%JAVA_MIN_MEM%" == "" ( - set JAVA_MIN_MEM=128M -) -if "%JAVA_MAX_MEM%" == "" ( - set JAVA_MAX_MEM=512M -) - -goto BEGIN - -:warn - echo %PROGNAME%: %* -goto :EOF - -:BEGIN - -rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -if not "%KARAF_HOME%" == "" ( - call :warn Ignoring predefined value for KARAF_HOME -) -set KARAF_HOME=%DIRNAME%.. -if not exist "%KARAF_HOME%" ( - call :warn KARAF_HOME is not valid: "%KARAF_HOME%" - goto END -) - -if not "%KARAF_BASE%" == "" ( - if not exist "%KARAF_BASE%" ( - call :warn KARAF_BASE is not valid: "%KARAF_BASE%" - goto END - ) -) -if "%KARAF_BASE%" == "" ( - set "KARAF_BASE=%KARAF_HOME%" -) - -if not "%KARAF_DATA%" == "" ( - if not exist "%KARAF_DATA%" ( - call :warn KARAF_DATA is not valid: "%KARAF_DATA%" - goto END - ) -) -if "%KARAF_DATA%" == "" ( - set "KARAF_DATA=%KARAF_BASE%\data" -) - -if not "%KARAF_ETC%" == "" ( - if not exist "%KARAF_ETC%" ( - call :warn KARAF_ETC is not valid: "%KARAF_ETC%" - goto END - ) -) -if "%KARAF_ETC%" == "" ( - set "KARAF_ETC=%KARAF_BASE%\etc" -) - -set DEFAULT_JAVA_OPTS= -if not "%ODL_JAVA_SECURITY_PROPERTIES%" == "" ( - set DEFAULT_JAVA_OPTS=-Djava.security.properties="%ODL_JAVA_SECURITY_PROPERTIES%" %DEFAULT_JAVA_OPTS% -) else ( - set DEFAULT_JAVA_OPTS=-Djava.security.properties="%KARAF_ETC%\odl.java.security" %DEFAULT_JAVA_OPTS% -) - -set DEFAULT_JAVA_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 - -rem Support for loading native libraries -set PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib - -rem Setup the Java Virtual Machine -if not "%JAVA%" == "" goto :Check_JAVA_END - set JAVA=java - if "%JAVA_HOME%" == "" call :warn JAVA_HOME not set; results may vary - if not "%JAVA_HOME%" == "" set JAVA=%JAVA_HOME%\bin\java - if not exist "%JAVA_HOME%" ( - call :warn JAVA_HOME is not valid: "%JAVA_HOME%" - goto END - ) -:Check_JAVA_END - -if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS% - -if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END - set JAVA_OPTS="%JAVA_OPTS% %EXTRA_JAVA_OPTS%" -:KARAF_EXTRA_JAVA_OPTS_END - -if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END - rem Use the defaults if JAVA_DEBUG_OPTS was not set - if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS% - - set JAVA_OPTS="%JAVA_DEBUG_OPTS% %JAVA_OPTS%" - call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS% -:KARAF_DEBUG_END - -rem Setup the classpath -pushd "%KARAF_HOME%\lib" -for %%G in (karaf*.jar) do call:APPEND_TO_CLASSPATH %%G -popd -goto CLASSPATH_END - -: APPEND_TO_CLASSPATH -set filename=%~1 -set suffix=%filename:~-4% -if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\%filename% -goto :EOF - -:CLASSPATH_END - -set CLASSPATH=%KARAF_HOME%\system\org\apache\karaf\instance\org.apache.karaf.instance.command\3.0.3\org.apache.karaf.instance.command-3.0.3.jar;%KARAF_HOME%\system\org\apache\karaf\instance\org.apache.karaf.instance.core\3.0.3\org.apache.karaf.instance.core-3.0.3.jar;%KARAF_HOME%\system\org\apache\karaf\shell\org.apache.karaf.shell.console\3.0.3\org.apache.karaf.shell.console-3.0.3.jar;%KARAF_HOME%\system\org\apache\karaf\shell\org.apache.karaf.shell.table\3.0.3\org.apache.karaf.shell.table-3.0.3.jar;%KARAF_HOME%\system\org\apache\aries\blueprint\org.apache.aries.blueprint.api\1.0.1\org.apache.aries.blueprint.api-1.0.1.jar;%KARAF_HOME%\system\org\apache\aries\blueprint\org.apache.aries.blueprint.core\1.4.2\org.apache.aries.blueprint.core-1.4.2.jar;%KARAF_HOME%\system\org\apache\aries\blueprint\org.apache.aries.blueprint.cm\1.0.5\org.apache.aries.blueprint.cm-1.0.5.jar;%KARAF_HOME%\system\org\ops4j\pax\logging\pax-logging-api\1.8.1\pax-logging-api-1.8.1.jar;%KARAF_HOME%\system\org\apache\felix\org.apache.felix.framework\4.2.1\org.apache.felix.framework-4.2.1.jar;%KARAF_HOME%\system\jline\jline\2.12\jline-2.12.jar;%CLASSPATH% - -:EXECUTE - if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8 - if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8 - rem Execute the Java Virtual Machine - "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %KARAF_OPTS% org.apache.karaf.instance.main.Execute %ARGS% - -rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -:END - -endlocal +@echo off +rem +rem +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. +rem + +if not "%ECHO%" == "" echo %ECHO% + +setlocal +set DIRNAME=%~dp0% +set PROGNAME=%~nx0% +set ARGS=%* + +rem Sourcing environment settings for karaf similar to tomcats setenv +SET KARAF_SCRIPT="instance.bat" +if exist "%DIRNAME%setenv.bat" ( + call "%DIRNAME%setenv.bat" +) + +rem Check console window title. Set to Karaf by default +if not "%KARAF_TITLE%" == "" ( + title %KARAF_TITLE% +) else ( + title Karaf +) + +rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage +if "%JAVA_MIN_MEM%" == "" ( + set JAVA_MIN_MEM=128M +) +if "%JAVA_MAX_MEM%" == "" ( + set JAVA_MAX_MEM=512M +) + +goto BEGIN + +:warn + echo %PROGNAME%: %* +goto :EOF + +:BEGIN + +rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +if not "%KARAF_HOME%" == "" ( + call :warn Ignoring predefined value for KARAF_HOME +) +set KARAF_HOME=%DIRNAME%.. +if not exist "%KARAF_HOME%" ( + call :warn KARAF_HOME is not valid: "%KARAF_HOME%" + goto END +) + +if not "%KARAF_BASE%" == "" ( + if not exist "%KARAF_BASE%" ( + call :warn KARAF_BASE is not valid: "%KARAF_BASE%" + goto END + ) +) +if "%KARAF_BASE%" == "" ( + set "KARAF_BASE=%KARAF_HOME%" +) + +if not "%KARAF_DATA%" == "" ( + if not exist "%KARAF_DATA%" ( + call :warn KARAF_DATA is not valid: "%KARAF_DATA%" + goto END + ) +) +if "%KARAF_DATA%" == "" ( + set "KARAF_DATA=%KARAF_BASE%\data" +) + +if not "%KARAF_ETC%" == "" ( + if not exist "%KARAF_ETC%" ( + call :warn KARAF_ETC is not valid: "%KARAF_ETC%" + goto END + ) +) +if "%KARAF_ETC%" == "" ( + set "KARAF_ETC=%KARAF_BASE%\etc" +) + +set DEFAULT_JAVA_OPTS= +if not "%ODL_JAVA_SECURITY_PROPERTIES%" == "" ( + set DEFAULT_JAVA_OPTS=-Djava.security.properties="%ODL_JAVA_SECURITY_PROPERTIES%" %DEFAULT_JAVA_OPTS% +) else ( + set DEFAULT_JAVA_OPTS=-Djava.security.properties="%KARAF_ETC%\odl.java.security" %DEFAULT_JAVA_OPTS% +) + +set DEFAULT_JAVA_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 + +rem Support for loading native libraries +set PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib + +rem Setup the Java Virtual Machine +if not "%JAVA%" == "" goto :Check_JAVA_END + set JAVA=java + if "%JAVA_HOME%" == "" call :warn JAVA_HOME not set; results may vary + if not "%JAVA_HOME%" == "" set JAVA=%JAVA_HOME%\bin\java + if not exist "%JAVA_HOME%" ( + call :warn JAVA_HOME is not valid: "%JAVA_HOME%" + goto END + ) +:Check_JAVA_END + +if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS% + +if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END + set JAVA_OPTS="%JAVA_OPTS% %EXTRA_JAVA_OPTS%" +:KARAF_EXTRA_JAVA_OPTS_END + +if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END + rem Use the defaults if JAVA_DEBUG_OPTS was not set + if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS% + + set JAVA_OPTS="%JAVA_DEBUG_OPTS% %JAVA_OPTS%" + call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS% +:KARAF_DEBUG_END + +rem Setup the classpath +pushd "%KARAF_HOME%\lib" +for %%G in (karaf*.jar) do call:APPEND_TO_CLASSPATH %%G +popd +goto CLASSPATH_END + +: APPEND_TO_CLASSPATH +set filename=%~1 +set suffix=%filename:~-4% +if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\%filename% +goto :EOF + +:CLASSPATH_END + +set CLASSPATH=%KARAF_HOME%\system\org\apache\karaf\instance\org.apache.karaf.instance.command\3.0.3\org.apache.karaf.instance.command-3.0.3.jar;%KARAF_HOME%\system\org\apache\karaf\instance\org.apache.karaf.instance.core\3.0.3\org.apache.karaf.instance.core-3.0.3.jar;%KARAF_HOME%\system\org\apache\karaf\shell\org.apache.karaf.shell.console\3.0.3\org.apache.karaf.shell.console-3.0.3.jar;%KARAF_HOME%\system\org\apache\karaf\shell\org.apache.karaf.shell.table\3.0.3\org.apache.karaf.shell.table-3.0.3.jar;%KARAF_HOME%\system\org\apache\aries\blueprint\org.apache.aries.blueprint.api\1.0.1\org.apache.aries.blueprint.api-1.0.1.jar;%KARAF_HOME%\system\org\apache\aries\blueprint\org.apache.aries.blueprint.core\1.4.2\org.apache.aries.blueprint.core-1.4.2.jar;%KARAF_HOME%\system\org\apache\aries\blueprint\org.apache.aries.blueprint.cm\1.0.5\org.apache.aries.blueprint.cm-1.0.5.jar;%KARAF_HOME%\system\org\ops4j\pax\logging\pax-logging-api\1.8.1\pax-logging-api-1.8.1.jar;%KARAF_HOME%\system\org\apache\felix\org.apache.felix.framework\4.2.1\org.apache.felix.framework-4.2.1.jar;%KARAF_HOME%\system\jline\jline\2.12\jline-2.12.jar;%CLASSPATH% + +:EXECUTE + if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8 + if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8 + rem Execute the Java Virtual Machine + "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %KARAF_OPTS% org.apache.karaf.instance.main.Execute %ARGS% + +rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +:END + +endlocal diff --git a/karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf.bat b/karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf.bat index a5c254a0bf..3d7ac2d9c1 100644 --- a/karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf.bat +++ b/karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf.bat @@ -1,347 +1,347 @@ -@echo off -rem -rem -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. -rem - -if not "%ECHO%" == "" echo %ECHO% - -setlocal -set DIRNAME=%~dp0% -set PROGNAME=%~nx0% -set ARGS=%* - -rem Sourcing environment settings for karaf similar to tomcats setenv -SET KARAF_SCRIPT="karaf.bat" -if exist "%DIRNAME%setenv.bat" ( - call "%DIRNAME%setenv.bat" -) - -rem Check console window title. Set to Karaf by default -if not "%KARAF_TITLE%" == "" ( - title %KARAF_TITLE% -) else ( - title Karaf -) - -rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage -if "%JAVA_MIN_MEM%" == "" ( - set JAVA_MIN_MEM=128M -) -if "%JAVA_MAX_MEM%" == "" ( - set JAVA_MAX_MEM=512M -) - -goto BEGIN - -:warn - echo %PROGNAME%: %* -goto :EOF - -:BEGIN - -rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -if not "%KARAF_HOME%" == "" ( - call :warn Ignoring predefined value for KARAF_HOME -) -set KARAF_HOME=%DIRNAME%.. -if not exist "%KARAF_HOME%" ( - call :warn KARAF_HOME is not valid: "%KARAF_HOME%" - goto END -) - -if not "%KARAF_BASE%" == "" ( - if not exist "%KARAF_BASE%" ( - call :warn KARAF_BASE is not valid: "%KARAF_BASE%" - goto END - ) -) -if "%KARAF_BASE%" == "" ( - set "KARAF_BASE=%KARAF_HOME%" -) - -if not "%KARAF_DATA%" == "" ( - if not exist "%KARAF_DATA%" ( - call :warn KARAF_DATA is not valid: "%KARAF_DATA%" - goto END - ) -) -if "%KARAF_DATA%" == "" ( - set "KARAF_DATA=%KARAF_BASE%\data" -) - -if not "%KARAF_ETC%" == "" ( - if not exist "%KARAF_ETC%" ( - call :warn KARAF_ETC is not valid: "%KARAF_ETC%" - goto END - ) -) -if "%KARAF_ETC%" == "" ( - set "KARAF_ETC=%KARAF_BASE%\etc" -) - -set LOCAL_CLASSPATH=%CLASSPATH% -set JAVA_MODE=-server - -set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf -set DEFAULT_JAVA_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 - -if "%LOCAL_CLASSPATH%" == "" goto :KARAF_CLASSPATH_EMPTY - set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf - goto :KARAF_CLASSPATH_END -:KARAF_CLASSPATH_EMPTY - set CLASSPATH=%KARAF_BASE%\conf -:KARAF_CLASSPATH_END - -rem Setup Karaf Home -if exist "%KARAF_HOME%\conf\karaf-rc.cmd" call %KARAF_HOME%\conf\karaf-rc.cmd -if exist "%HOME%\karaf-rc.cmd" call %HOME%\karaf-rc.cmd - -rem Support for loading native libraries -set PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib - -rem Setup the Java Virtual Machine -if not "%JAVA%" == "" goto :Check_JAVA_END - if not "%JAVA_HOME%" == "" goto :TryJDKEnd - call :warn JAVA_HOME not set; results may vary -:TryJRE - start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" - if not exist __reg1.txt goto :TryJDK - type __reg1.txt | find "CurrentVersion" > __reg2.txt - if errorlevel 1 goto :TryJDK - for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x - if errorlevel 1 goto :TryJDK - set JavaTemp=%JavaTemp%## - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp:##=% - del __reg1.txt - del __reg2.txt - start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\%JavaTemp%" - if not exist __reg1.txt goto :TryJDK - type __reg1.txt | find "JavaHome" > __reg2.txt - if errorlevel 1 goto :TryJDK - for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x - if errorlevel 1 goto :TryJDK - del __reg1.txt - del __reg2.txt - goto TryJDKEnd -:TryJDK - start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit" - if not exist __reg1.txt ( - goto TryRegJRE - ) - type __reg1.txt | find "CurrentVersion" > __reg2.txt - if errorlevel 1 ( - goto TryRegJRE - ) - for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x - if errorlevel 1 ( - goto TryRegJRE - ) - set JavaTemp=%JavaTemp%## - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp: ##=##% - set JavaTemp=%JavaTemp:##=% - del __reg1.txt - del __reg2.txt - start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\%JavaTemp%" - if not exist __reg1.txt ( - goto TryRegJRE - ) - type __reg1.txt | find "JavaHome" > __reg2.txt - if errorlevel 1 ( - goto TryRegJRE - ) - for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x - if errorlevel 1 ( - goto TryRegJRE - ) - del __reg1.txt - del __reg2.txt -:TryRegJRE - rem try getting the JAVA_HOME from registry - FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion`) DO ( - set JAVA_VERSION=%%A - ) - FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%JAVA_VERSION%" /v JavaHome`) DO ( - set JAVA_HOME=%%A %%B - ) - if not exist "%JAVA_HOME%" ( - goto TryRegJDK - ) - goto TryJDKEnd -:TryRegJDK - rem try getting the JAVA_HOME from registry - FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit" /v CurrentVersion`) DO ( - set JAVA_VERSION=%%A - ) - FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit\%JAVA_VERSION%" /v JavaHome`) DO ( - set JAVA_HOME=%%A %%B - ) - if not exist "%JAVA_HOME%" ( - call :warn Unable to retrieve JAVA_HOME from Registry - ) - goto TryJDKEnd -:TryJDKEnd - if not exist "%JAVA_HOME%" ( - call :warn JAVA_HOME is not valid: "%JAVA_HOME%" - goto END - ) - set JAVA=%JAVA_HOME%\bin\java -:Check_JAVA_END - -if not exist "%JAVA_HOME%\bin\server\jvm.dll" ( - if not exist "%JAVA_HOME%\jre\bin\server\jvm.dll" ( - echo WARNING: Running Karaf on a Java HotSpot Client VM because server-mode is not available. - echo Install Java Developer Kit to fix this. - echo For more details see http://java.sun.com/products/hotspot/whitepaper.html#client - set JAVA_MODE=-client - ) -) - -set DEFAULT_JAVA_OPTS=%JAVA_MODE% -Xms%JAVA_MIN_MEM% -Xmx%JAVA_MAX_MEM% -Dderby.system.home="%KARAF_DATA%\derby" -Dderby.storage.fileSyncTransactionLog=true -Dcom.sun.management.jmxremote -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass - -if not "%ODL_JAVA_SECURITY_PROPERTIES%" == "" ( - set DEFAULT_JAVA_OPTS=-Djava.security.properties="%ODL_JAVA_SECURITY_PROPERTIES%" %DEFAULT_JAVA_OPTS% -) else ( - set DEFAULT_JAVA_OPTS=-Djava.security.properties="%KARAF_ETC%\odl.java.security" %DEFAULT_JAVA_OPTS% -) - -rem Check some easily accessible MIN/MAX params for JVM mem usage -if not "%JAVA_PERM_MEM%" == "" ( - set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:PermSize=%JAVA_PERM_MEM% -) -if not "%JAVA_MAX_PERM_MEM%" == "" ( - set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:MaxPermSize=%JAVA_MAX_PERM_MEM% -) - -if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS% - -if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END - set JAVA_OPTS=%JAVA_OPTS% %EXTRA_JAVA_OPTS% -:KARAF_EXTRA_JAVA_OPTS_END - -if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END - if "%1" == "stop" goto :KARAF_DEBUG_END - if "%1" == "client" goto :KARAF_DEBUG_END - rem Use the defaults if JAVA_DEBUG_OPTS was not set - if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS% - - set JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS% - call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS% -:KARAF_DEBUG_END - -if "%KARAF_PROFILER%" == "" goto :KARAF_PROFILER_END - set KARAF_PROFILER_SCRIPT=%KARAF_HOME%\conf\profiler\%KARAF_PROFILER%.cmd - - if exist "%KARAF_PROFILER_SCRIPT%" goto :KARAF_PROFILER_END - call :warn Missing configuration for profiler '%KARAF_PROFILER%': %KARAF_PROFILER_SCRIPT% - goto END -:KARAF_PROFILER_END - -rem Setup the classpath -pushd "%KARAF_HOME%\lib" -for %%G in (karaf*.jar) do call:APPEND_TO_CLASSPATH %%G -popd -goto CLASSPATH_END - -: APPEND_TO_CLASSPATH -set filename=%~1 -set suffix=%filename:~-4% -if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\%filename% -goto :EOF - -:CLASSPATH_END - -rem Execute the JVM or the load the profiler -if "%KARAF_PROFILER%" == "" goto :RUN - rem Execute the profiler if it has been configured - call :warn Loading profiler script: %KARAF_PROFILER_SCRIPT% - call %KARAF_PROFILER_SCRIPT% - -:RUN - SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true - SET MAIN=org.apache.karaf.main.Main - SET SHIFT=false - -:RUN_LOOP - if "%1" == "stop" goto :EXECUTE_STOP - if "%1" == "status" goto :EXECUTE_STATUS - if "%1" == "console" goto :EXECUTE_CONSOLE - if "%1" == "server" goto :EXECUTE_SERVER - if "%1" == "client" goto :EXECUTE_CLIENT - if "%1" == "clean" goto :EXECUTE_CLEAN - if "%1" == "debug" goto :EXECUTE_DEBUG - goto :EXECUTE - -:EXECUTE_STOP - SET MAIN=org.apache.karaf.main.Stop - shift - goto :RUN_LOOP - -:EXECUTE_STATUS - SET MAIN=org.apache.karaf.main.Status - shift - goto :RUN_LOOP - -:EXECUTE_CONSOLE - shift - goto :RUN_LOOP - -:EXECUTE_SERVER - SET OPTS=-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true - shift - goto :RUN_LOOP - -:EXECUTE_CLIENT - SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=false - shift - goto :RUN_LOOP - -:EXECUTE_CLEAN - rmdir /S /Q "%KARAF_DATA%" - shift - goto :RUN_LOOP - -:EXECUTE_DEBUG - if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS% - set JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS% - shift - goto :RUN_LOOP - -:EXECUTE - SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8 - rem Execute the Java Virtual Machine - cd "%KARAF_BASE%" - "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Dkaraf.data="%KARAF_DATA%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %KARAF_OPTS% %MAIN% %ARGS% - -rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -:END - -endlocal - -if not "%PAUSE%" == "" pause - -:END_NO_PAUSE +@echo off +rem +rem +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. +rem + +if not "%ECHO%" == "" echo %ECHO% + +setlocal +set DIRNAME=%~dp0% +set PROGNAME=%~nx0% +set ARGS=%* + +rem Sourcing environment settings for karaf similar to tomcats setenv +SET KARAF_SCRIPT="karaf.bat" +if exist "%DIRNAME%setenv.bat" ( + call "%DIRNAME%setenv.bat" +) + +rem Check console window title. Set to Karaf by default +if not "%KARAF_TITLE%" == "" ( + title %KARAF_TITLE% +) else ( + title Karaf +) + +rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage +if "%JAVA_MIN_MEM%" == "" ( + set JAVA_MIN_MEM=128M +) +if "%JAVA_MAX_MEM%" == "" ( + set JAVA_MAX_MEM=512M +) + +goto BEGIN + +:warn + echo %PROGNAME%: %* +goto :EOF + +:BEGIN + +rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +if not "%KARAF_HOME%" == "" ( + call :warn Ignoring predefined value for KARAF_HOME +) +set KARAF_HOME=%DIRNAME%.. +if not exist "%KARAF_HOME%" ( + call :warn KARAF_HOME is not valid: "%KARAF_HOME%" + goto END +) + +if not "%KARAF_BASE%" == "" ( + if not exist "%KARAF_BASE%" ( + call :warn KARAF_BASE is not valid: "%KARAF_BASE%" + goto END + ) +) +if "%KARAF_BASE%" == "" ( + set "KARAF_BASE=%KARAF_HOME%" +) + +if not "%KARAF_DATA%" == "" ( + if not exist "%KARAF_DATA%" ( + call :warn KARAF_DATA is not valid: "%KARAF_DATA%" + goto END + ) +) +if "%KARAF_DATA%" == "" ( + set "KARAF_DATA=%KARAF_BASE%\data" +) + +if not "%KARAF_ETC%" == "" ( + if not exist "%KARAF_ETC%" ( + call :warn KARAF_ETC is not valid: "%KARAF_ETC%" + goto END + ) +) +if "%KARAF_ETC%" == "" ( + set "KARAF_ETC=%KARAF_BASE%\etc" +) + +set LOCAL_CLASSPATH=%CLASSPATH% +set JAVA_MODE=-server + +set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf +set DEFAULT_JAVA_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 + +if "%LOCAL_CLASSPATH%" == "" goto :KARAF_CLASSPATH_EMPTY + set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf + goto :KARAF_CLASSPATH_END +:KARAF_CLASSPATH_EMPTY + set CLASSPATH=%KARAF_BASE%\conf +:KARAF_CLASSPATH_END + +rem Setup Karaf Home +if exist "%KARAF_HOME%\conf\karaf-rc.cmd" call %KARAF_HOME%\conf\karaf-rc.cmd +if exist "%HOME%\karaf-rc.cmd" call %HOME%\karaf-rc.cmd + +rem Support for loading native libraries +set PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib + +rem Setup the Java Virtual Machine +if not "%JAVA%" == "" goto :Check_JAVA_END + if not "%JAVA_HOME%" == "" goto :TryJDKEnd + call :warn JAVA_HOME not set; results may vary +:TryJRE + start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" + if not exist __reg1.txt goto :TryJDK + type __reg1.txt | find "CurrentVersion" > __reg2.txt + if errorlevel 1 goto :TryJDK + for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x + if errorlevel 1 goto :TryJDK + set JavaTemp=%JavaTemp%## + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp:##=% + del __reg1.txt + del __reg2.txt + start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\%JavaTemp%" + if not exist __reg1.txt goto :TryJDK + type __reg1.txt | find "JavaHome" > __reg2.txt + if errorlevel 1 goto :TryJDK + for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x + if errorlevel 1 goto :TryJDK + del __reg1.txt + del __reg2.txt + goto TryJDKEnd +:TryJDK + start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit" + if not exist __reg1.txt ( + goto TryRegJRE + ) + type __reg1.txt | find "CurrentVersion" > __reg2.txt + if errorlevel 1 ( + goto TryRegJRE + ) + for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x + if errorlevel 1 ( + goto TryRegJRE + ) + set JavaTemp=%JavaTemp%## + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp: ##=##% + set JavaTemp=%JavaTemp:##=% + del __reg1.txt + del __reg2.txt + start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\%JavaTemp%" + if not exist __reg1.txt ( + goto TryRegJRE + ) + type __reg1.txt | find "JavaHome" > __reg2.txt + if errorlevel 1 ( + goto TryRegJRE + ) + for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x + if errorlevel 1 ( + goto TryRegJRE + ) + del __reg1.txt + del __reg2.txt +:TryRegJRE + rem try getting the JAVA_HOME from registry + FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion`) DO ( + set JAVA_VERSION=%%A + ) + FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%JAVA_VERSION%" /v JavaHome`) DO ( + set JAVA_HOME=%%A %%B + ) + if not exist "%JAVA_HOME%" ( + goto TryRegJDK + ) + goto TryJDKEnd +:TryRegJDK + rem try getting the JAVA_HOME from registry + FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit" /v CurrentVersion`) DO ( + set JAVA_VERSION=%%A + ) + FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit\%JAVA_VERSION%" /v JavaHome`) DO ( + set JAVA_HOME=%%A %%B + ) + if not exist "%JAVA_HOME%" ( + call :warn Unable to retrieve JAVA_HOME from Registry + ) + goto TryJDKEnd +:TryJDKEnd + if not exist "%JAVA_HOME%" ( + call :warn JAVA_HOME is not valid: "%JAVA_HOME%" + goto END + ) + set JAVA=%JAVA_HOME%\bin\java +:Check_JAVA_END + +if not exist "%JAVA_HOME%\bin\server\jvm.dll" ( + if not exist "%JAVA_HOME%\jre\bin\server\jvm.dll" ( + echo WARNING: Running Karaf on a Java HotSpot Client VM because server-mode is not available. + echo Install Java Developer Kit to fix this. + echo For more details see http://java.sun.com/products/hotspot/whitepaper.html#client + set JAVA_MODE=-client + ) +) + +set DEFAULT_JAVA_OPTS=%JAVA_MODE% -Xms%JAVA_MIN_MEM% -Xmx%JAVA_MAX_MEM% -Dderby.system.home="%KARAF_DATA%\derby" -Dderby.storage.fileSyncTransactionLog=true -Dcom.sun.management.jmxremote -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass + +if not "%ODL_JAVA_SECURITY_PROPERTIES%" == "" ( + set DEFAULT_JAVA_OPTS=-Djava.security.properties="%ODL_JAVA_SECURITY_PROPERTIES%" %DEFAULT_JAVA_OPTS% +) else ( + set DEFAULT_JAVA_OPTS=-Djava.security.properties="%KARAF_ETC%\odl.java.security" %DEFAULT_JAVA_OPTS% +) + +rem Check some easily accessible MIN/MAX params for JVM mem usage +if not "%JAVA_PERM_MEM%" == "" ( + set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:PermSize=%JAVA_PERM_MEM% +) +if not "%JAVA_MAX_PERM_MEM%" == "" ( + set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:MaxPermSize=%JAVA_MAX_PERM_MEM% +) + +if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS% + +if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END + set JAVA_OPTS=%JAVA_OPTS% %EXTRA_JAVA_OPTS% +:KARAF_EXTRA_JAVA_OPTS_END + +if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END + if "%1" == "stop" goto :KARAF_DEBUG_END + if "%1" == "client" goto :KARAF_DEBUG_END + rem Use the defaults if JAVA_DEBUG_OPTS was not set + if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS% + + set JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS% + call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS% +:KARAF_DEBUG_END + +if "%KARAF_PROFILER%" == "" goto :KARAF_PROFILER_END + set KARAF_PROFILER_SCRIPT=%KARAF_HOME%\conf\profiler\%KARAF_PROFILER%.cmd + + if exist "%KARAF_PROFILER_SCRIPT%" goto :KARAF_PROFILER_END + call :warn Missing configuration for profiler '%KARAF_PROFILER%': %KARAF_PROFILER_SCRIPT% + goto END +:KARAF_PROFILER_END + +rem Setup the classpath +pushd "%KARAF_HOME%\lib" +for %%G in (karaf*.jar) do call:APPEND_TO_CLASSPATH %%G +popd +goto CLASSPATH_END + +: APPEND_TO_CLASSPATH +set filename=%~1 +set suffix=%filename:~-4% +if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\%filename% +goto :EOF + +:CLASSPATH_END + +rem Execute the JVM or the load the profiler +if "%KARAF_PROFILER%" == "" goto :RUN + rem Execute the profiler if it has been configured + call :warn Loading profiler script: %KARAF_PROFILER_SCRIPT% + call %KARAF_PROFILER_SCRIPT% + +:RUN + SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true + SET MAIN=org.apache.karaf.main.Main + SET SHIFT=false + +:RUN_LOOP + if "%1" == "stop" goto :EXECUTE_STOP + if "%1" == "status" goto :EXECUTE_STATUS + if "%1" == "console" goto :EXECUTE_CONSOLE + if "%1" == "server" goto :EXECUTE_SERVER + if "%1" == "client" goto :EXECUTE_CLIENT + if "%1" == "clean" goto :EXECUTE_CLEAN + if "%1" == "debug" goto :EXECUTE_DEBUG + goto :EXECUTE + +:EXECUTE_STOP + SET MAIN=org.apache.karaf.main.Stop + shift + goto :RUN_LOOP + +:EXECUTE_STATUS + SET MAIN=org.apache.karaf.main.Status + shift + goto :RUN_LOOP + +:EXECUTE_CONSOLE + shift + goto :RUN_LOOP + +:EXECUTE_SERVER + SET OPTS=-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true + shift + goto :RUN_LOOP + +:EXECUTE_CLIENT + SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=false + shift + goto :RUN_LOOP + +:EXECUTE_CLEAN + rmdir /S /Q "%KARAF_DATA%" + shift + goto :RUN_LOOP + +:EXECUTE_DEBUG + if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS% + set JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS% + shift + goto :RUN_LOOP + +:EXECUTE + SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8 + rem Execute the Java Virtual Machine + cd "%KARAF_BASE%" + "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Dkaraf.data="%KARAF_DATA%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %KARAF_OPTS% %MAIN% %ARGS% + +rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +:END + +endlocal + +if not "%PAUSE%" == "" pause + +:END_NO_PAUSE diff --git a/opendaylight/commons/checkstyle/src/main/resources/controller/checkstyle.xml b/opendaylight/commons/checkstyle/src/main/resources/controller/checkstyle.xml index 2b7462ac68..78c38f5678 100644 --- a/opendaylight/commons/checkstyle/src/main/resources/controller/checkstyle.xml +++ b/opendaylight/commons/checkstyle/src/main/resources/controller/checkstyle.xml @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Acceptor.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Acceptor.java index 80986e5c66..7127f00c79 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Acceptor.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Acceptor.java @@ -1,19 +1,19 @@ -/* - * Copyright (c) 2013, 2015 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -public interface Acceptor { - - /** - * - * @param input - * @return true if input is accepted. - */ - boolean isAcceptable(I input); -} +/* + * Copyright (c) 2013, 2015 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +public interface Acceptor { + + /** + * + * @param input + * @return true if input is accepted. + */ + boolean isAcceptable(I input); +} diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/AggregateTransformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/AggregateTransformer.java index 061a57fc15..c89bf25c1b 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/AggregateTransformer.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/AggregateTransformer.java @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -import java.util.Collection; -/** - * - * @author Tony Tkacik - * - * @param - * @param

- */ -public interface AggregateTransformer extends Transformer { - - Collection

transformAll(Collection inputs); -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +import java.util.Collection; +/** + * + * @author Tony Tkacik + * + * @param + * @param

+ */ +public interface AggregateTransformer extends Transformer { + + Collection

transformAll(Collection inputs); +} diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeClassBasedTransformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeClassBasedTransformer.java index dae949912b..2548c340d5 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeClassBasedTransformer.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeClassBasedTransformer.java @@ -1,121 +1,121 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - - -/** - * Transformer which aggregates multiple implementations of - * {@link InputClassBasedTransformer}. - * - * The transformation process is driven by {@link Class} of input. The selection - * of used {@link InputClassBasedTransformer} is done by using the {@link Class} - * of input as a key to select the transformer. - * - * This approach provides quick resolution of transformer, but does not support - * registering a super type of input to provide transformation support for all - * subclasses, one must register a new instance of transformer for each valid - * input class. - * - * If you need more flexible selection of transformation consider using - * {@link CompositeConditionalTransformer} which is slower but most flexible or - * {@link RuleBasedTransformer} which provides declarative approach for - * transformation. - * - * See {@link #transform(Object)} for more information about tranformation - * process. - * - * @author Tony Tkacik - * - * @param - * Input super-type - * @param

- * Product - */ -public abstract class CompositeClassBasedTransformer implements - InputClassBasedTransformer, - AggregateTransformer { - - private Map, InputClassBasedTransformer> transformers = new ConcurrentHashMap, InputClassBasedTransformer>(); - - /** - * Transforms an input into instance of Product class. - * - * The final registered transformer is the one which match following - * condition: - * - * input.getClass() == transformer.getInputClass() - * - * This means that transformers are not resolved by class hierarchy, only - * selected based on final class of the input. If you need more flexible - * selection of transformation consider using - * {@link CompositeConditionalTransformer} which is slower but more - * flexible. - * - */ - @Override - public P transform(I input) { - @SuppressWarnings("unchecked") - InputClassBasedTransformer transformer = (InputClassBasedTransformer) transformers - .get(input.getClass()); - if (transformer == null) - throw new IllegalArgumentException("Transformation of: " + input - + " is not supported"); - return transformer.transform(input); - } - - /** - * Registers a new transformer. - * - * The transformer is registered for class returned by - * {@link InputClassBasedTransformer#getInputClass()}. Only one transformer - * can be registered for particular input class. - * - */ - public void addTransformer( - InputClassBasedTransformer transformer) - throws IllegalStateException { - if (transformer == null) - throw new IllegalArgumentException("Transformer should not be null"); - if (transformer.getInputClass() == null) - throw new IllegalArgumentException( - "Transformer should specify input class."); - transformers.put(transformer.getInputClass(), transformer); - } - - /** - * Removes an registered transformer. - * - * Note: Removal is currently unsupported. - * - * @param transformer - * Tranformer to be removed. - * @throws IllegalArgumentException - * If the provided transformer is null or is not registered. - */ - public void removeTransformer( - InputClassBasedTransformer transformer) - throws IllegalArgumentException { - throw new UnsupportedOperationException("Not implemented yet"); - } - - @Override - public Collection

transformAll(Collection inputs) { - Collection

ret = new ArrayList

(); - for (I i : inputs) { - ret.add(transform(i)); - } - return ret; - } - -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + + +/** + * Transformer which aggregates multiple implementations of + * {@link InputClassBasedTransformer}. + * + * The transformation process is driven by {@link Class} of input. The selection + * of used {@link InputClassBasedTransformer} is done by using the {@link Class} + * of input as a key to select the transformer. + * + * This approach provides quick resolution of transformer, but does not support + * registering a super type of input to provide transformation support for all + * subclasses, one must register a new instance of transformer for each valid + * input class. + * + * If you need more flexible selection of transformation consider using + * {@link CompositeConditionalTransformer} which is slower but most flexible or + * {@link RuleBasedTransformer} which provides declarative approach for + * transformation. + * + * See {@link #transform(Object)} for more information about tranformation + * process. + * + * @author Tony Tkacik + * + * @param + * Input super-type + * @param

+ * Product + */ +public abstract class CompositeClassBasedTransformer implements + InputClassBasedTransformer, + AggregateTransformer { + + private Map, InputClassBasedTransformer> transformers = new ConcurrentHashMap, InputClassBasedTransformer>(); + + /** + * Transforms an input into instance of Product class. + * + * The final registered transformer is the one which match following + * condition: + * + * input.getClass() == transformer.getInputClass() + * + * This means that transformers are not resolved by class hierarchy, only + * selected based on final class of the input. If you need more flexible + * selection of transformation consider using + * {@link CompositeConditionalTransformer} which is slower but more + * flexible. + * + */ + @Override + public P transform(I input) { + @SuppressWarnings("unchecked") + InputClassBasedTransformer transformer = (InputClassBasedTransformer) transformers + .get(input.getClass()); + if (transformer == null) + throw new IllegalArgumentException("Transformation of: " + input + + " is not supported"); + return transformer.transform(input); + } + + /** + * Registers a new transformer. + * + * The transformer is registered for class returned by + * {@link InputClassBasedTransformer#getInputClass()}. Only one transformer + * can be registered for particular input class. + * + */ + public void addTransformer( + InputClassBasedTransformer transformer) + throws IllegalStateException { + if (transformer == null) + throw new IllegalArgumentException("Transformer should not be null"); + if (transformer.getInputClass() == null) + throw new IllegalArgumentException( + "Transformer should specify input class."); + transformers.put(transformer.getInputClass(), transformer); + } + + /** + * Removes an registered transformer. + * + * Note: Removal is currently unsupported. + * + * @param transformer + * Tranformer to be removed. + * @throws IllegalArgumentException + * If the provided transformer is null or is not registered. + */ + public void removeTransformer( + InputClassBasedTransformer transformer) + throws IllegalArgumentException { + throw new UnsupportedOperationException("Not implemented yet"); + } + + @Override + public Collection

transformAll(Collection inputs) { + Collection

ret = new ArrayList

(); + for (I i : inputs) { + ret.add(transform(i)); + } + return ret; + } + +} diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeConditionalTransformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeConditionalTransformer.java index d11f319a79..0cdc3a156f 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeConditionalTransformer.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeConditionalTransformer.java @@ -1,157 +1,157 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.Set; -import java.util.TreeSet; - -/** - * Composite transformer which aggregates multiple implementation and selects - * the one which accepts the input. - * - * - * @author Tony Tkacik - * - * @param - * Input class for transformation - * @param

- * Product of transformation - */ -public class CompositeConditionalTransformer implements - SimpleConditionalTransformer, - AggregateTransformer { - - private final Comparator> comparator = new Comparator>() { - - @Override - public int compare(TransformerWithPriority o1, - TransformerWithPriority o2) { - return Integer.valueOf(o1.priority).compareTo(Integer.valueOf(o2.priority)); - } - - }; - private final Set> transformers; - - public CompositeConditionalTransformer() { - // FIXME: Add Ordering - transformers = new TreeSet>(comparator); - } - - @Override - public boolean isAcceptable(I input) { - for (SimpleConditionalTransformer trans : transformers) { - if (trans.isAcceptable(input)) { - return true; - } - } - return false; - } - - @Override - public P transform(I input) { - for (SimpleConditionalTransformer trans : transformers) { - if (trans.isAcceptable(input)) { - return trans.transform(input); - } - } - throw new IllegalStateException( - "Transformer for provided input is not available."); - } - - public void addTransformer(SimpleConditionalTransformer transformer, - int priority) throws IllegalStateException { - if (transformer == null) { - throw new IllegalArgumentException( - "transformer should not be null."); - } - TransformerWithPriority withPriority = new TransformerWithPriority( - transformer, priority); - if (false == transformers.add(withPriority)) { - throw new IllegalStateException("transformer " + transformer - + "already registered"); - } - } - - public void removeTransformer(SimpleConditionalTransformer transformer) - throws IllegalArgumentException { - if (transformer == null) { - throw new IllegalArgumentException( - "transformer should not be null."); - } - if (false == transformers.remove(transformer)) { - throw new IllegalStateException("transformer " + transformer - + "already registered"); - } - } - - @Override - public Collection

transformAll(Collection inputs) { - Collection

ret = new ArrayList

(); - for (I i : inputs) { - ret.add(transform(i)); - } - return ret; - } - - private static class TransformerWithPriority implements - SimpleConditionalTransformer { - final int priority; - final SimpleConditionalTransformer transformer; - - public TransformerWithPriority( - SimpleConditionalTransformer transformer, int priority) { - this.priority = priority; - this.transformer = transformer; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((transformer == null) ? 0 : transformer.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - TransformerWithPriority other = (TransformerWithPriority) obj; - if (transformer == null) { - if (other.transformer != null) - return false; - } else if (!transformer.equals(other.transformer)) - return false; - return true; - } - - @Override - public boolean isAcceptable(I input) { - return transformer.isAcceptable(input); - } - - @Override - public P transform(I input) { - return transformer.transform(input); - } - - - - - - } -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.Set; +import java.util.TreeSet; + +/** + * Composite transformer which aggregates multiple implementation and selects + * the one which accepts the input. + * + * + * @author Tony Tkacik + * + * @param + * Input class for transformation + * @param

+ * Product of transformation + */ +public class CompositeConditionalTransformer implements + SimpleConditionalTransformer, + AggregateTransformer { + + private final Comparator> comparator = new Comparator>() { + + @Override + public int compare(TransformerWithPriority o1, + TransformerWithPriority o2) { + return Integer.valueOf(o1.priority).compareTo(Integer.valueOf(o2.priority)); + } + + }; + private final Set> transformers; + + public CompositeConditionalTransformer() { + // FIXME: Add Ordering + transformers = new TreeSet>(comparator); + } + + @Override + public boolean isAcceptable(I input) { + for (SimpleConditionalTransformer trans : transformers) { + if (trans.isAcceptable(input)) { + return true; + } + } + return false; + } + + @Override + public P transform(I input) { + for (SimpleConditionalTransformer trans : transformers) { + if (trans.isAcceptable(input)) { + return trans.transform(input); + } + } + throw new IllegalStateException( + "Transformer for provided input is not available."); + } + + public void addTransformer(SimpleConditionalTransformer transformer, + int priority) throws IllegalStateException { + if (transformer == null) { + throw new IllegalArgumentException( + "transformer should not be null."); + } + TransformerWithPriority withPriority = new TransformerWithPriority( + transformer, priority); + if (false == transformers.add(withPriority)) { + throw new IllegalStateException("transformer " + transformer + + "already registered"); + } + } + + public void removeTransformer(SimpleConditionalTransformer transformer) + throws IllegalArgumentException { + if (transformer == null) { + throw new IllegalArgumentException( + "transformer should not be null."); + } + if (false == transformers.remove(transformer)) { + throw new IllegalStateException("transformer " + transformer + + "already registered"); + } + } + + @Override + public Collection

transformAll(Collection inputs) { + Collection

ret = new ArrayList

(); + for (I i : inputs) { + ret.add(transform(i)); + } + return ret; + } + + private static class TransformerWithPriority implements + SimpleConditionalTransformer { + final int priority; + final SimpleConditionalTransformer transformer; + + public TransformerWithPriority( + SimpleConditionalTransformer transformer, int priority) { + this.priority = priority; + this.transformer = transformer; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((transformer == null) ? 0 : transformer.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + TransformerWithPriority other = (TransformerWithPriority) obj; + if (transformer == null) { + if (other.transformer != null) + return false; + } else if (!transformer.equals(other.transformer)) + return false; + return true; + } + + @Override + public boolean isAcceptable(I input) { + return transformer.isAcceptable(input); + } + + @Override + public P transform(I input) { + return transformer.transform(input); + } + + + + + + } +} diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/InputClassBasedTransformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/InputClassBasedTransformer.java index 1ad849bddc..1bec9bceb6 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/InputClassBasedTransformer.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/InputClassBasedTransformer.java @@ -1,38 +1,38 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -/** - * Input class based transformer - * - * {@link Transformer} which accepts / transforms only specific classes of - * input, and is useful if the selection of transformer should be based on the - * class of the input and there is one-to-one mapping between input class and - * transformer. - * - * - * @author Tony Tkacik - * - * @param - * Common supertype of input - * @param - * Concrete type of input - * @param

- * Product - */ -public interface InputClassBasedTransformer extends - Transformer { - - /** - * Returns an {@link Class} of input which is acceptable for transformation. - * - * @return {@link Class} of input which is acceptable for transformation. - */ - Class getInputClass(); -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +/** + * Input class based transformer + * + * {@link Transformer} which accepts / transforms only specific classes of + * input, and is useful if the selection of transformer should be based on the + * class of the input and there is one-to-one mapping between input class and + * transformer. + * + * + * @author Tony Tkacik + * + * @param + * Common supertype of input + * @param + * Concrete type of input + * @param

+ * Product + */ +public interface InputClassBasedTransformer extends + Transformer { + + /** + * Returns an {@link Class} of input which is acceptable for transformation. + * + * @return {@link Class} of input which is acceptable for transformation. + */ + Class getInputClass(); +} diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/RuleBasedTransformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/RuleBasedTransformer.java index 820b94a7ac..9a0d8798cf 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/RuleBasedTransformer.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/RuleBasedTransformer.java @@ -1,42 +1,42 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -import java.util.Set; - -/** - * Transformer with set of acceptance rules - * - * The transformer provides a set of {@link Acceptor}s, which could be used to - * verify if the input will produce result using the transformer. - * - * The transormer is able to produce result if ANY of associated - * {@link Acceptor}s accepted result. - * - * @author Tony Tkacik - * - * @param - * Input class for transformation - * @param

- * Product of transformation - */ -public interface RuleBasedTransformer extends Transformer { - - /** - * Set of {@link Acceptor}, which could be used to verify if the input is - * usable by transformer. - * - * The transformer is able to produce result if ANY of associated - * {@link Acceptor}s accepted result. - * - * @return Set of input acceptance rules associated to this transformer. - */ - Set> getRules(); - -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +import java.util.Set; + +/** + * Transformer with set of acceptance rules + * + * The transformer provides a set of {@link Acceptor}s, which could be used to + * verify if the input will produce result using the transformer. + * + * The transormer is able to produce result if ANY of associated + * {@link Acceptor}s accepted result. + * + * @author Tony Tkacik + * + * @param + * Input class for transformation + * @param

+ * Product of transformation + */ +public interface RuleBasedTransformer extends Transformer { + + /** + * Set of {@link Acceptor}, which could be used to verify if the input is + * usable by transformer. + * + * The transformer is able to produce result if ANY of associated + * {@link Acceptor}s accepted result. + * + * @return Set of input acceptance rules associated to this transformer. + */ + Set> getRules(); + +} diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/SimpleConditionalTransformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/SimpleConditionalTransformer.java index 4d0aa03e15..84770b71b1 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/SimpleConditionalTransformer.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/SimpleConditionalTransformer.java @@ -1,38 +1,38 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -/** - * Simple condition-based transformer - * - * The transformer provides {@link #isAcceptable(Object)} method, - * which could be used to query transformer if the input will produce - * result. - * - * This interface is simplified version of {@link RuleBasedTransformer} - does not - * provide decoupling of Acceptance rule from transformer, and should be used only - * for simple use-cases. - * - * @author Tony Tkacik - * - * @param Input class for transformation - * @param

Product of transformation - */ -public interface SimpleConditionalTransformer extends Transformer, Acceptor { - - - /** - * Checks if the input is acceptable - * for processing by the transformer. - * - * @return true it the input is acceptable for processing by transformer. - */ - @Override - public boolean isAcceptable(I input); -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +/** + * Simple condition-based transformer + * + * The transformer provides {@link #isAcceptable(Object)} method, + * which could be used to query transformer if the input will produce + * result. + * + * This interface is simplified version of {@link RuleBasedTransformer} - does not + * provide decoupling of Acceptance rule from transformer, and should be used only + * for simple use-cases. + * + * @author Tony Tkacik + * + * @param Input class for transformation + * @param

Product of transformation + */ +public interface SimpleConditionalTransformer extends Transformer, Acceptor { + + + /** + * Checks if the input is acceptable + * for processing by the transformer. + * + * @return true it the input is acceptable for processing by transformer. + */ + @Override + public boolean isAcceptable(I input); +} diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Transformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Transformer.java index 18184e122a..6f09d8b7d6 100644 --- a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Transformer.java +++ b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Transformer.java @@ -1,27 +1,27 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ - -package org.opendaylight.controller.concepts.transform; - -/** - * Factory which produces product based on input object - * - * @author Tony Tkacik - * - * @param Input - * @param

Product - */ -public interface Transformer { - /** - * Transforms input into instance of product. - * - * @param input Input which drives transformation - * @return Instance of product which was created from supplied input. - */ - P transform(I input); -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ + +package org.opendaylight.controller.concepts.transform; + +/** + * Factory which produces product based on input object + * + * @author Tony Tkacik + * + * @param Input + * @param

Product + */ +public interface Transformer { + /** + * Transforms input into instance of product. + * + * @param input Input which drives transformation + * @return Instance of product which was created from supplied input. + */ + P transform(I input); +} diff --git a/opendaylight/commons/liblldp/src/test/resources/log4j.xml b/opendaylight/commons/liblldp/src/test/resources/log4j.xml index 9196fc4af2..e47e51a467 100644 --- a/opendaylight/commons/liblldp/src/test/resources/log4j.xml +++ b/opendaylight/commons/liblldp/src/test/resources/log4j.xml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/opendaylight/md-sal/messagebus-config/pom.xml b/opendaylight/md-sal/messagebus-config/pom.xml index 2401376b32..0b8eead52e 100644 --- a/opendaylight/md-sal/messagebus-config/pom.xml +++ b/opendaylight/md-sal/messagebus-config/pom.xml @@ -1,73 +1,73 @@ - - - - - 4.0.0 - - - org.opendaylight.controller - sal-parent - 1.3.0-SNAPSHOT - - - messagebus-config - jar - Configuration files for message-bus - - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - messagebus-api - ${project.version} - - - org.opendaylight.controller - messagebus-impl - ${project.version} - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/initial/05-message-bus.xml - xml - config - - - - - - - - - - - scm:git:http://git.opendaylight.org/gerrit/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - HEAD - https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=summary - - + + + + + 4.0.0 + + + org.opendaylight.controller + sal-parent + 1.3.0-SNAPSHOT + + + messagebus-config + jar + Configuration files for message-bus + + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + messagebus-api + ${project.version} + + + org.opendaylight.controller + messagebus-impl + ${project.version} + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/initial/05-message-bus.xml + xml + config + + + + + + + + + + + scm:git:http://git.opendaylight.org/gerrit/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=summary + + diff --git a/opendaylight/md-sal/messagebus-impl/pom.xml b/opendaylight/md-sal/messagebus-impl/pom.xml index 108a295bb7..7f1d7c5bbc 100644 --- a/opendaylight/md-sal/messagebus-impl/pom.xml +++ b/opendaylight/md-sal/messagebus-impl/pom.xml @@ -1,142 +1,142 @@ - - - - 4.0.0 - - - org.opendaylight.controller - sal-parent - 1.3.0-SNAPSHOT - - - messagebus-impl - ${project.artifactId} - - bundle - - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.yangtools - yang-data-impl - - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - messagebus-api - - - org.opendaylight.controller - messagebus-util - - - org.opendaylight.controller - messagebus-spi - - - org.opendaylight.controller - sal-binding-config - - - - - junit - junit - test - - - org.glassfish.jersey.test-framework.providers - jersey-test-framework-provider-grizzly2 - test - - - org.mockito - mockito-all - test - - - - - - - org.opendaylight.yangtools - yang-maven-plugin - - - - generate-sources - - - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - - - ${project.build.directory}/generated-sources/sal - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${project.build.directory}/generated-sources/config - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl - target/site/models - - - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - generate-sources - - add-source - - - - ${project.build.directory}/generated-sources/config - - - - - - - - + + + + 4.0.0 + + + org.opendaylight.controller + sal-parent + 1.3.0-SNAPSHOT + + + messagebus-impl + ${project.artifactId} + + bundle + + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + sal-core-api + + + org.opendaylight.controller + sal-common-util + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.controller + config-api + + + org.opendaylight.controller + messagebus-api + + + org.opendaylight.controller + messagebus-util + + + org.opendaylight.controller + messagebus-spi + + + org.opendaylight.controller + sal-binding-config + + + + + junit + junit + test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + test + + + org.mockito + mockito-all + test + + + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + + generate-sources + + + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + + + ${project.build.directory}/generated-sources/sal + + + + + org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator + + ${project.build.directory}/generated-sources/config + + + urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang + + + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/config + + + + + + + + diff --git a/opendaylight/md-sal/messagebus-util/pom.xml b/opendaylight/md-sal/messagebus-util/pom.xml index 0bb1e9193f..37973e03b0 100644 --- a/opendaylight/md-sal/messagebus-util/pom.xml +++ b/opendaylight/md-sal/messagebus-util/pom.xml @@ -1,59 +1,59 @@ - - - - 4.0.0 - - - org.opendaylight.controller - sal-parent - 1.3.0-SNAPSHOT - - - messagebus-util - ${project.artifactId} - - bundle - - - - org.osgi - org.osgi.core - - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - messagebus-api - - - - junit - junit - test - - - org.glassfish.jersey.test-framework.providers - jersey-test-framework-provider-grizzly2 - test - - - org.mockito - mockito-all - test - - - + + + + 4.0.0 + + + org.opendaylight.controller + sal-parent + 1.3.0-SNAPSHOT + + + messagebus-util + ${project.artifactId} + + bundle + + + + org.osgi + org.osgi.core + + + org.opendaylight.controller + sal-core-api + + + org.opendaylight.controller + sal-binding-api + + + org.opendaylight.controller + messagebus-api + + + + junit + junit + test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + test + + + org.mockito + mockito-all + test + + + diff --git a/opendaylight/md-sal/sal-dom-config/src/main/yang/opendaylight-md-sal-common.yang b/opendaylight/md-sal/sal-dom-config/src/main/yang/opendaylight-md-sal-common.yang index b7a0bc0b99..ac2f924408 100644 --- a/opendaylight/md-sal/sal-dom-config/src/main/yang/opendaylight-md-sal-common.yang +++ b/opendaylight/md-sal/sal-dom-config/src/main/yang/opendaylight-md-sal-common.yang @@ -1,71 +1,71 @@ -module opendaylight-md-sal-common { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:common"; - prefix "md-sal-common"; - - description - "Common definition for MD-SAL."; - - revision "2013-10-28" { - description - "Initial revision"; - } - - grouping rpc-routing-table { - - leaf routing-context { - type string; - } - list routes { - leaf path { - type string; - } - leaf destination { - type string; - } - } - - } - - grouping rpc-router { - leaf module { - type string; - } - container routing-tables { - list routing-table { - uses rpc-routing-table; - } - } - } - - grouping rpc-state { - list rpc-router { - uses rpc-router; - } - } - - grouping notification-state { - container notifications { - leaf published { - type uint32; - } - } - } - - grouping data-state { - container transactions { - leaf created { - type uint32; - } - leaf submitted { - type uint32; - } - leaf successful { - type uint32; - } - leaf failed { - type uint32; - } - } - } +module opendaylight-md-sal-common { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:common"; + prefix "md-sal-common"; + + description + "Common definition for MD-SAL."; + + revision "2013-10-28" { + description + "Initial revision"; + } + + grouping rpc-routing-table { + + leaf routing-context { + type string; + } + list routes { + leaf path { + type string; + } + leaf destination { + type string; + } + } + + } + + grouping rpc-router { + leaf module { + type string; + } + container routing-tables { + list routing-table { + uses rpc-routing-table; + } + } + } + + grouping rpc-state { + list rpc-router { + uses rpc-router; + } + } + + grouping notification-state { + container notifications { + leaf published { + type uint32; + } + } + } + + grouping data-state { + container transactions { + leaf created { + type uint32; + } + leaf submitted { + type uint32; + } + leaf successful { + type uint32; + } + leaf failed { + type uint32; + } + } + } } \ No newline at end of file diff --git a/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/BrokerModule.java b/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/BrokerModule.java index 99438c86b8..670598d39e 100644 --- a/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/BrokerModule.java +++ b/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/BrokerModule.java @@ -1,27 +1,27 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ -package org.opendaylight.controller.sal.core.spi; - -import java.util.Set; - -import org.opendaylight.controller.sal.core.api.BrokerService; -import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession; -import org.opendaylight.controller.sal.core.api.Consumer.ConsumerFunctionality; -import org.opendaylight.controller.sal.core.api.Provider.ProviderFunctionality; - -public interface BrokerModule { - - Set> getProvidedServices(); - - Set> getSupportedConsumerFunctionality(); - - T getServiceForSession(Class service, - ConsumerSession session); - - Set> getSupportedProviderFunctionality(); -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ +package org.opendaylight.controller.sal.core.spi; + +import java.util.Set; + +import org.opendaylight.controller.sal.core.api.BrokerService; +import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession; +import org.opendaylight.controller.sal.core.api.Consumer.ConsumerFunctionality; +import org.opendaylight.controller.sal.core.api.Provider.ProviderFunctionality; + +public interface BrokerModule { + + Set> getProvidedServices(); + + Set> getSupportedConsumerFunctionality(); + + T getServiceForSession(Class service, + ConsumerSession session); + + Set> getSupportedProviderFunctionality(); +} diff --git a/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/package-info.java b/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/package-info.java index ec3b69813e..8c8ee3db80 100644 --- a/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/package-info.java +++ b/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/package-info.java @@ -1,8 +1,8 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. 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 - */ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. 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 + */ package org.opendaylight.controller.sal.core.spi.data; \ No newline at end of file diff --git a/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/package-info.java b/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/package-info.java index 76493afd18..6cab2a8749 100644 --- a/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/package-info.java +++ b/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/package-info.java @@ -1,8 +1,8 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 - */ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. 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 + */ package org.opendaylight.controller.sal.core.spi; \ No newline at end of file diff --git a/opendaylight/md-sal/sal-dom-xsql-config/pom.xml b/opendaylight/md-sal/sal-dom-xsql-config/pom.xml index c692e305c3..d9d1f7b3b1 100644 --- a/opendaylight/md-sal/sal-dom-xsql-config/pom.xml +++ b/opendaylight/md-sal/sal-dom-xsql-config/pom.xml @@ -1,56 +1,56 @@ - - - - 4.0.0 - - - sal-parent - org.opendaylight.controller - 1.3.0-SNAPSHOT - - sal-dom-xsql-config - Configuration files for md-sal - jar - - - 04-xsql.xml - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/${configfile} - xml - config - - - - - - - - - - scm:git:http://git.opendaylight.org/gerrit/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - HEAD - https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=summary - - + + + + 4.0.0 + + + sal-parent + org.opendaylight.controller + 1.3.0-SNAPSHOT + + sal-dom-xsql-config + Configuration files for md-sal + jar + + + 04-xsql.xml + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/${configfile} + xml + config + + + + + + + + + + scm:git:http://git.opendaylight.org/gerrit/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + HEAD + https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=summary + + diff --git a/opendaylight/md-sal/sal-karaf-xsql/pom.xml b/opendaylight/md-sal/sal-karaf-xsql/pom.xml index f06e8449c4..c1d4df0c6b 100644 --- a/opendaylight/md-sal/sal-karaf-xsql/pom.xml +++ b/opendaylight/md-sal/sal-karaf-xsql/pom.xml @@ -1,104 +1,104 @@ - - - - - - 4.0.0 - - - sal-parent - org.opendaylight.controller - 1.3.0-SNAPSHOT - - - org.opendaylight.controller - sal-karaf-xsql - bundle - Apache Karaf :: Shell odl/xsql Commands - - Provides the OSGi odl commands - - - - org.apache.karaf.shell - org.apache.karaf.shell.console - ${karaf.version} - - - - org.osgi - org.osgi.core - 5.0.0 - provided - - - - org.osgi - org.osgi.compendium - 5.0.0 - provided - - - - junit - junit - 4.11 - test - - - org.opendaylight.controller - sal-dom-xsql - 1.3.0-SNAPSHOT - - - - - - - maven-compiler-plugin - true - 2.3.2 - - 1.5 - 1.5 - - - - org.apache.felix - maven-bundle-plugin - 2.4.0 - true - - - ${project.artifactId} - org.opendaylight.controller.xsql*;version=${project.version} - !org.opendaylight.controller.xsql*, - org.apache.aries.blueprint, - org.osgi.service.blueprint.container, - org.osgi.service.blueprint.reflect, - org.apache.felix.service.command, - org.apache.karaf.shell.commands, - org.apache.karaf.shell.console, - * - - - - - - - + + + + + + 4.0.0 + + + sal-parent + org.opendaylight.controller + 1.3.0-SNAPSHOT + + + org.opendaylight.controller + sal-karaf-xsql + bundle + Apache Karaf :: Shell odl/xsql Commands + + Provides the OSGi odl commands + + + + org.apache.karaf.shell + org.apache.karaf.shell.console + ${karaf.version} + + + + org.osgi + org.osgi.core + 5.0.0 + provided + + + + org.osgi + org.osgi.compendium + 5.0.0 + provided + + + + junit + junit + 4.11 + test + + + org.opendaylight.controller + sal-dom-xsql + 1.3.0-SNAPSHOT + + + + + + + maven-compiler-plugin + true + 2.3.2 + + 1.5 + 1.5 + + + + org.apache.felix + maven-bundle-plugin + 2.4.0 + true + + + ${project.artifactId} + org.opendaylight.controller.xsql*;version=${project.version} + !org.opendaylight.controller.xsql*, + org.apache.aries.blueprint, + org.osgi.service.blueprint.container, + org.osgi.service.blueprint.reflect, + org.apache.felix.service.command, + org.apache.karaf.shell.commands, + org.apache.karaf.shell.console, + * + + + + + + + -- 2.36.6