Guillaume Nodet | 129433d | 2009-07-09 08:29:14 +0000 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- |
| 3 | |
| 4 | Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 | contributor license agreements. See the NOTICE file distributed with |
| 6 | this work for additional information regarding copyright ownership. |
| 7 | The ASF licenses this file to You under the Apache License, Version 2.0 |
| 8 | (the "License"); you may not use this file except in compliance with |
| 9 | the License. You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | |
| 19 | --> |
| 20 | <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" |
| 21 | xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"> |
| 22 | |
| 23 | <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/> |
| 24 | |
| 25 | <reference id="commandProcessor" interface="org.osgi.service.command.CommandProcessor"> |
| 26 | <reference-listener ref="consoleFactory" |
| 27 | bind-method="registerCommandProcessor" |
| 28 | unbind-method="unregisterCommandProcessor"/> |
| 29 | </reference> |
| 30 | |
| 31 | <reference-list id="functions" filter="(&(osgi.command.scope=*)(osgi.command.function=*))" |
| 32 | availability="optional"> |
| 33 | <reference-listener ref="commandCompleter" |
| 34 | bind-method="register" |
| 35 | unbind-method="unregister"/> |
| 36 | </reference-list> |
| 37 | |
| 38 | <bean id="commandCompleter" class="org.apache.felix.karaf.gshell.console.completer.CommandsCompleter"> |
| 39 | <property name="bundleContext" ref="blueprintBundleContext"/> |
| 40 | </bean> |
| 41 | |
| 42 | <bean id="consoleFactory" class="org.apache.felix.karaf.gshell.console.jline.ConsoleFactory"> |
| 43 | <property name="start" value="$[karaf.startLocalConsole]"/> |
| 44 | <property name="bundleContext" ref="blueprintBundleContext"/> |
| 45 | <property name="completers"> |
| 46 | <list> |
| 47 | <ref component-id="commandCompleter"/> |
| 48 | </list> |
| 49 | </property> |
| 50 | <property name="terminal" ref="terminal"/> |
| 51 | </bean> |
| 52 | |
| 53 | <bean id="terminal" |
| 54 | factory-ref="terminalFactory" |
| 55 | factory-method="getTerminal"/> |
| 56 | |
| 57 | <bean id="terminalFactory" class="org.apache.felix.karaf.gshell.console.jline.TerminalFactory" |
| 58 | init-method="init" |
| 59 | destroy-method="destroy"/> |
| 60 | |
| 61 | |
| 62 | </blueprint> |