Repository: karaf Updated Branches: refs/heads/master b10a00979 -> 137c3a437
[KARAF-3404] Add a demo for profiles Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/0575750e Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/0575750e Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/0575750e Branch: refs/heads/master Commit: 0575750e21318acdafd189a0e9b19d1270f94f4e Parents: 90cb480 Author: Guillaume Nodet <[email protected]> Authored: Wed Dec 10 23:58:57 2014 +0100 Committer: Guillaume Nodet <[email protected]> Committed: Thu Dec 11 00:02:07 2014 +0100 ---------------------------------------------------------------------- demos/pom.xml | 1 + demos/profiles/dynamic/pom.xml | 134 +++++++++++++++++++ demos/profiles/pom.xml | 41 ++++++ demos/profiles/registry/pom.xml | 35 +++++ .../activemq/broker.profile/profile.cfg | 21 +++ .../activemq/client.profile/profile.cfg | 20 +++ .../main/resources/camel.profile/profile.cfg | 23 ++++ .../main/resources/default.profile/jetty.xml | 68 ++++++++++ .../default.profile/org.ops4j.pax.web.cfg | 21 +++ .../main/resources/default.profile/profile.cfg | 31 +++++ .../main/resources/default.profile/version.cfg | 23 ++++ .../example/loanbroker/bank1.profile/bank1.xml | 44 ++++++ .../loanbroker/bank1.profile/profile.cfg | 20 +++ .../example/loanbroker/bank2.profile/bank2.xml | 44 ++++++ .../loanbroker/bank2.profile/profile.cfg | 20 +++ .../example/loanbroker/bank3.profile/bank3.xml | 44 ++++++ .../loanbroker/bank3.profile/profile.cfg | 20 +++ .../example/loanbroker/base.profile/profile.cfg | 22 +++ .../loanbroker/broker.profile/loanBroker.xml | 85 ++++++++++++ .../loanbroker/broker.profile/profile.cfg | 20 +++ .../karaf.profile/org.ops4j.pax.logging.cfg | 54 ++++++++ .../main/resources/karaf.profile/profile.cfg | 40 ++++++ 22 files changed, 831 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/pom.xml ---------------------------------------------------------------------- diff --git a/demos/pom.xml b/demos/pom.xml index 673a65c..6c42c6c 100644 --- a/demos/pom.xml +++ b/demos/pom.xml @@ -39,6 +39,7 @@ <module>command</module> <module>dump</module> <module>deployer</module> + <module>profiles</module> </modules> </project> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/dynamic/pom.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/dynamic/pom.xml b/demos/profiles/dynamic/pom.xml new file mode 100644 index 0000000..3f5e5c7 --- /dev/null +++ b/demos/profiles/dynamic/pom.xml @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.karaf</groupId> + <artifactId>karaf</artifactId> + <version>4.0.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <groupId>org.apache.karaf.demos.profiles</groupId> + <artifactId>dynamic</artifactId> + <name>Apache Karaf :: Demos :: Profiles :: Dynamic Assembly</name> + + <dependencies> + <dependency> + <groupId>org.apache.karaf.features</groupId> + <artifactId>framework</artifactId> + <type>kar</type> + </dependency> + <dependency> + <groupId>org.apache.karaf.features</groupId> + <artifactId>standard</artifactId> + <classifier>features</classifier> + <type>xml</type> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.apache.karaf.features</groupId> + <artifactId>spring</artifactId> + <classifier>features</classifier> + <type>xml</type> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>${project.basedir}/../..</directory> + <filtering>false</filtering> + <includes> + <include>README</include> + <include>RELEASE*</include> + <include>LICENSE</include> + <include>NOTICE</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>process-resources</id> + <goals> + <goal>resources</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-remote-resources-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.karaf.tooling</groupId> + <artifactId>karaf-maven-plugin</artifactId> + <executions> + <execution> + <id>process-resources</id> + <phase>process-resources</phase> + <goals> + <goal>install-kars</goal> + </goals> + </execution> + <execution> + <id>package</id> + <goals> + <goal>instance-create-archive</goal> + </goals> + </execution> + </executions> + <configuration> + <!-- + <profilesArtifact> + org.apache.karaf.demo.profiles:org.apache.karaf.demo.profiles.registry + </profilesArtifact> + --> + <profilesDirectory> + ${basedir}/../registry/src/main/resources + </profilesDirectory> + <bootFeatures> + <feature>deployer</feature> + </bootFeatures> + <bootProfiles> + <profile>karaf</profile> + <profile>example-loanbroker-bank1</profile> + <profile>example-loanbroker-bank2</profile> + <profile>example-loanbroker-bank3</profile> + <profile>example-loanbroker-broker</profile> + <profile>activemq-broker</profile> + </bootProfiles> + </configuration> + </plugin> + + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/pom.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/pom.xml b/demos/profiles/pom.xml new file mode 100644 index 0000000..fdc5621 --- /dev/null +++ b/demos/profiles/pom.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.karaf</groupId> + <artifactId>karaf</artifactId> + <version>4.0.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <groupId>org.apache.karaf.demos.profiles</groupId> + <artifactId>profiles</artifactId> + <packaging>pom</packaging> + <name>Apache Karaf :: Demos :: Profiles</name> + + <modules> + <module>registry</module> + <module>dynamic</module> + </modules> + +</project> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/pom.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/pom.xml b/demos/profiles/registry/pom.xml new file mode 100644 index 0000000..34762e9 --- /dev/null +++ b/demos/profiles/registry/pom.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.karaf</groupId> + <artifactId>karaf</artifactId> + <version>4.0.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <groupId>org.apache.karaf.demos.profiles</groupId> + <artifactId>registry</artifactId> + <name>Apache Karaf :: Demos :: Profiles :: Registry</name> + +</project> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/activemq/broker.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/activemq/broker.profile/profile.cfg b/demos/profiles/registry/src/main/resources/activemq/broker.profile/profile.cfg new file mode 100644 index 0000000..269c1f9 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/activemq/broker.profile/profile.cfg @@ -0,0 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = karaf + +feature.aries-bluerint = aries-blueprint +feature.activemq-broker = activemq-broker http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/activemq/client.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/activemq/client.profile/profile.cfg b/demos/profiles/registry/src/main/resources/activemq/client.profile/profile.cfg new file mode 100644 index 0000000..57705a6 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/activemq/client.profile/profile.cfg @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = karaf + +feature.activemq-client = activemq-client http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/camel.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/camel.profile/profile.cfg b/demos/profiles/registry/src/main/resources/camel.profile/profile.cfg new file mode 100644 index 0000000..8e80b7b --- /dev/null +++ b/demos/profiles/registry/src/main/resources/camel.profile/profile.cfg @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents=karaf + +feature.aries-blueprint = aries-blueprint +feature.shell-compat = shell-compat +feature.camel-core = camel-core +feature.camel-blueprint = camel-blueprint http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/default.profile/jetty.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/default.profile/jetty.xml b/demos/profiles/registry/src/main/resources/default.profile/jetty.xml new file mode 100644 index 0000000..9b0a59f --- /dev/null +++ b/demos/profiles/registry/src/main/resources/default.profile/jetty.xml @@ -0,0 +1,68 @@ +<?xml version="1.0"?> + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting// +DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> + +<Configure class="org.eclipse.jetty.server.Server"> + + <!-- =========================================================== --> + <!-- Set connectors --> + <!-- =========================================================== --> + <!-- One of each type! --> + <!-- =========================================================== --> + + <!-- Use this connector for many frequently idle connections + and for threadless continuations. + --> + <Call name="addConnector"> + <Arg> + <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> + <Set name="host"> + <Property name="jetty.host"/> + </Set> + <!-- We explicitly set port to 0 to avoid port conflicts, then a real port will be picked + from org.ops4j.pax.web pid, which is PortService aware + --> + <Set name="port"> + <Property name="jetty.port" default="0"/> + </Set> + <Set name="maxIdleTime">300000</Set> + <Set name="Acceptors">2</Set> + <Set name="statsOn">false</Set> + <Set name="confidentialPort">8443</Set> + <Set name="lowResourcesConnections">20000</Set> + <Set name="lowResourcesMaxIdleTime">5000</Set> + </New> + </Arg> + </Call> + + <Call name="addBean"> + <Arg> + <New class="org.eclipse.jetty.plus.jaas.JAASLoginService"> + <Set name="name">karaf</Set> + <Set name="loginModuleName">karaf</Set> + <Set name="roleClassNames"> + <Array type="java.lang.String"> + <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal</Item> + </Array> + </Set> + </New> + </Arg> + </Call> +</Configure> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/default.profile/org.ops4j.pax.web.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/default.profile/org.ops4j.pax.web.cfg b/demos/profiles/registry/src/main/resources/default.profile/org.ops4j.pax.web.cfg new file mode 100644 index 0000000..8e6231e --- /dev/null +++ b/demos/profiles/registry/src/main/resources/default.profile/org.ops4j.pax.web.cfg @@ -0,0 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +org.osgi.service.http.port=${port:8181,8282} +javax.servlet.context.tempdir=${runtime.data}/pax-web-jsp +org.ops4j.pax.web.config.url=profile:jetty.xml +org.ops4j.pax.web.config.checksum=${checksum:profile\:jetty.xml} http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/default.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/default.profile/profile.cfg b/demos/profiles/registry/src/main/resources/default.profile/profile.cfg new file mode 100644 index 0000000..08f0801 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/default.profile/profile.cfg @@ -0,0 +1,31 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#framework=mvn\:org.apache.felix/org.apache.felix.framework/${felix.framework.version} +repository.karaf-standard=mvn\:org.apache.karaf.assemblies.features/standard/${profile:version/karaf}/xml/features + +org.ops4j.pax.url.mvn.repositories= \ + file:${runtime.home}/${karaf.default.repository}@snapshots@id=karaf-default, \ + http://repo1.maven.org/maven2@id=central, \ + https://repo.fusesource.com/nexus/content/groups/public@id=fusepublic, \ + https://repository.jboss.org/nexus/content/repositories/public@id=jbosspublic, \ + https://repo.fusesource.com/nexus/content/repositories/releases@id=jbossreleases, \ + https://repo.fusesource.com/nexus/content/groups/ea@id=jbossearlyaccess, \ + http://repository.springsource.com/maven/bundles/release@id=ebrreleases, \ + http://repository.springsource.com/maven/bundles/external@id=ebrexternal + + http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/default.profile/version.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/default.profile/version.cfg b/demos/profiles/registry/src/main/resources/default.profile/version.cfg new file mode 100644 index 0000000..71348fc --- /dev/null +++ b/demos/profiles/registry/src/main/resources/default.profile/version.cfg @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# common version numbers so its easy to change version numbers in one place + +activemq = 5.10.0 +camel = 2.14.0 +cxf = 3.1.0-SNAPSHOT +karaf = 4.0.0-SNAPSHOT http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/bank1.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/bank1.xml b/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/bank1.xml new file mode 100644 index 0000000..f01c29e --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/bank1.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"> + + <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="Bank1Context" trace="false"> + <route id="Bank1"> + <from uri="activemq:LoanBroker.Bank1"/> + <setHeader headerName="host.bank"> + <simple>${sys.runtime.id}-${camelId}</simple> + </setHeader> + <delay> + <constant>80</constant> + </delay> + <setHeader headerName="loan.rate"> + <simple>5.2</simple> + </setHeader> + <log message=">>> Bank1 loan rate: ${header.loan.rate}"/> + </route> + </camelContext> + + <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> + <property name="brokerURL" value="tcp://localhost:61616"/> + <property name="userName" value="karaf"/> + <property name="password" value="karaf"/> + </bean> + +</blueprint> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/profile.cfg b/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/profile.cfg new file mode 100644 index 0000000..0fe0414 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/bank1.profile/profile.cfg @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = example-loanbroker-base + +bundle.profile-bank1.xml=blueprint:profile:bank1.xml http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/bank2.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/bank2.xml b/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/bank2.xml new file mode 100644 index 0000000..b4d5588 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/bank2.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"> + + <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="Bank2Context" trace="false"> + <route id="Bank2"> + <from uri="activemq:LoanBroker.Bank2"/> + <setHeader headerName="host.bank"> + <simple>${sys.runtime.id}-${camelId}</simple> + </setHeader> + <delay> + <constant>30</constant> + </delay> + <setHeader headerName="loan.rate"> + <simple>4.2</simple> + </setHeader> + <log message=">>> Bank2 loan rate: ${header.loan.rate}"/> + </route> + </camelContext> + + <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> + <property name="brokerURL" value="tcp://localhost:61616"/> + <property name="userName" value="karaf"/> + <property name="password" value="karaf"/> + </bean> + +</blueprint> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/profile.cfg b/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/profile.cfg new file mode 100644 index 0000000..72c2ddd --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/bank2.profile/profile.cfg @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = example-loanbroker-base + +bundle.profile-bank2.xml=blueprint:profile:bank2.xml http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/bank3.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/bank3.xml b/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/bank3.xml new file mode 100644 index 0000000..9c74f44 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/bank3.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"> + + <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="Bank3Context" trace="false"> + <route id="Bank3"> + <from uri="activemq:LoanBroker.Bank3"/> + <setHeader headerName="host.bank"> + <simple>${sys.runtime.id}-${camelId}</simple> + </setHeader> + <delay> + <constant>40</constant> + </delay> + <setHeader headerName="loan.rate"> + <simple>4.4</simple> + </setHeader> + <log message=">>> Bank3 loan rate: ${header.loan.rate}"/> + </route> + </camelContext> + + <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> + <property name="brokerURL" value="tcp://localhost:61616"/> + <property name="userName" value="karaf"/> + <property name="password" value="karaf"/> + </bean> + +</blueprint> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/profile.cfg b/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/profile.cfg new file mode 100644 index 0000000..cd37032 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/bank3.profile/profile.cfg @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = example-loanbroker-base + +bundle.profile-bank3.xml=blueprint:profile:bank3.xml http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/base.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/base.profile/profile.cfg b/demos/profiles/registry/src/main/resources/example/loanbroker/base.profile/profile.cfg new file mode 100644 index 0000000..7adeadb --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/base.profile/profile.cfg @@ -0,0 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = camel activemq-client +attribute.abstract = true + +feature.activemq-camel = activemq-camel + http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/loanBroker.xml ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/loanBroker.xml b/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/loanBroker.xml new file mode 100644 index 0000000..261f270 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/loanBroker.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> + <!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"> + + <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="LoanBroker"> + + <!-- the banks --> + <endpoint id="Bank1" uri="activemq:LoanBroker.Bank1"/> + <endpoint id="Bank2" uri="activemq:LoanBroker.Bank2"/> + <endpoint id="Bank3" uri="activemq:LoanBroker.Bank3"/> + + <route id="LoanRequests"> + <from uri="timer://LoanRequests?fixedRate=true&period=5000"/> + <removeHeader headerName="firedTime"/> + <setExchangePattern pattern="InOut"/> + <to uri="activemq:LoanBroker.LoanBrokerService"/> + </route> + + <route id="LoanBroker"> + <from uri="activemq:LoanBroker.LoanBrokerService"/> + <setHeader headerName="host.loan.broker"> + <simple>${sys.runtime.id}</simple> + </setHeader> + <to uri="activemq:LoanBroker.CreditBureauService"/> + <log message=">>> Credit score : ${header.credit.score}"/> + <to uri="activemq:LoanBroker.RuleBaseService"/> + <log message=">>> Bank list : ${header.bank.list}"/> + <!-- call the banks and pick the winning bank with the best rate --> + <recipientList parallelProcessing="false"> + <header>bank.list</header> + </recipientList> + <log message=">>> Loan rate : ${header.loan.rate} , from bank : ${header.host.bank}"/> + </route> + + <route id="CreditBureau"> + <from uri="activemq:LoanBroker.CreditBureauService"/> + <setHeader headerName="host.credit.bureau"> + <simple>${sys.runtime.id}</simple> + </setHeader> + <delay> + <constant>100</constant> + </delay> + <setHeader headerName="credit.score"> + <simple>7</simple> + </setHeader> + </route> + + <route id="RuleBase"> + <from uri="activemq:LoanBroker.RuleBaseService"/> + <setHeader headerName="host.rule.base"> + <simple>${sys.runtime.id}</simple> + </setHeader> + <delay> + <constant>50</constant> + </delay> + <setHeader headerName="bank.list"> + <simple>Bank1,Bank2,Bank3</simple> + </setHeader> + </route> + </camelContext> + + <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> + <property name="brokerURL" value="tcp://localhost:61616"/> + <property name="userName" value="karaf"/> + <property name="password" value="karaf"/> + </bean> + +</blueprint> http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/profile.cfg b/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/profile.cfg new file mode 100644 index 0000000..74523af --- /dev/null +++ b/demos/profiles/registry/src/main/resources/example/loanbroker/broker.profile/profile.cfg @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = example-loanbroker-base + +bundle.profile-loanBroker.xml = blueprint:profile:loanBroker.xml http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/karaf.profile/org.ops4j.pax.logging.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/karaf.profile/org.ops4j.pax.logging.cfg b/demos/profiles/registry/src/main/resources/karaf.profile/org.ops4j.pax.logging.cfg new file mode 100644 index 0000000..767b7c8 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/karaf.profile/org.ops4j.pax.logging.cfg @@ -0,0 +1,54 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Root logger +log4j.rootLogger=INFO, out, osgi:* +log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer + +# CONSOLE appender not used by default +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n +# use this for source code lines enabled in the logs (beware it impacts performance) +#log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n + +# File appender +log4j.appender.out=org.apache.log4j.RollingFileAppender +log4j.appender.out.layout=org.apache.log4j.PatternLayout +log4j.appender.out.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n +# use this for source code lines enabled in the logs (beware it impacts performance) +#log4j.appender.out.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n +log4j.appender.out.file=${karaf.data}/log/karaf.log +log4j.appender.out.append=true +log4j.appender.out.maxFileSize=100MB +log4j.appender.out.maxBackupIndex=10 + +# Sift appender +log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender +log4j.appender.sift.key=bundle.name +log4j.appender.sift.default=karaf +log4j.appender.sift.appender=org.apache.log4j.FileAppender +log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout +log4j.appender.sift.appender.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %m%n +# use this for source code lines enabled in the logs (beware it impacts performance) +#log4j.appender.sift.appender.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n +log4j.appender.sift.appender.file=${karaf.data}/log/$\\{bundle.name\\}.log +log4j.appender.sift.appender.append=true + +# To avoid flooding the log when using DEBUG level on an ssh connection and doing log:tail +log4j.logger.org.apache.sshd.server.channel.ChannelSession = INFO + http://git-wip-us.apache.org/repos/asf/karaf/blob/0575750e/demos/profiles/registry/src/main/resources/karaf.profile/profile.cfg ---------------------------------------------------------------------- diff --git a/demos/profiles/registry/src/main/resources/karaf.profile/profile.cfg b/demos/profiles/registry/src/main/resources/karaf.profile/profile.cfg new file mode 100644 index 0000000..1ad1b57 --- /dev/null +++ b/demos/profiles/registry/src/main/resources/karaf.profile/profile.cfg @@ -0,0 +1,40 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +attribute.parents = default + +repository.karaf-enterprise = mvn\:org.apache.karaf.features/enterprise/${profile:version/karaf}/xml/features +repository.karaf-standard = mvn\:org.apache.karaf.features/standard/${profile:version/karaf}/xml/features +repository.karaf-spring = mvn\:org.apache.karaf.features/spring/${profile:version/karaf}/xml/features + +# lets include the camel, cxf and activemq features by default so they can be resolved automatically when deploying projects +repository.apache-camel = mvn\:org.apache.camel.karaf/apache-camel/${profile:version/camel}/xml/features +repository.apache-cxf = mvn\:org.apache.cxf.karaf/apache-cxf/${profile:version/cxf}/xml/features +repository.apache-activemq = mvn\:org.apache.activemq/activemq-karaf/${profile:version/activemq}/xml/features + +# Basic features +feature.karaf-jaas = jaas +feature.karaf-shell = shell +feature.karaf-ssh = ssh +feature.karaf-bundle = bundle +feature.karaf-config = config +feature.karaf-instance = instance +feature.karaf-log = log +feature.karaf-package = package +feature.karaf-service = service +feature.karaf-system = system +feature.karaf-management = management
