|
ActiveMQ example source code file (ActiveMQCommand.java)
The ActiveMQ ActiveMQCommand.java source code/** * * 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. */ package org.apache.activemq.karaf.commands; import java.lang.reflect.Field; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.felix.gogo.commands.Action; import org.apache.felix.gogo.commands.Argument; import org.apache.felix.gogo.commands.basic.AbstractCommand; import org.apache.felix.gogo.commands.basic.ActionPreparator; import org.apache.felix.gogo.commands.basic.DefaultActionPreparator; import org.apache.felix.service.command.CommandSession; import org.apache.karaf.shell.console.BlueprintContainerAware; import org.apache.karaf.shell.console.BundleContextAware; import org.apache.karaf.shell.console.CompletableFunction; import org.apache.karaf.shell.console.Completer; import org.apache.karaf.shell.console.commands.GenericType; import org.osgi.framework.BundleContext; import org.osgi.service.blueprint.container.BlueprintContainer; import org.osgi.service.blueprint.container.Converter; /** * Base command to process options and wrap native ActiveMQ console commands. */ public class ActiveMQCommand extends AbstractCommand implements CompletableFunction { protected BlueprintContainer blueprintContainer; protected Converter blueprintConverter; protected String actionId; protected List<Completer> completers; public void setBlueprintContainer(BlueprintContainer blueprintContainer) { this.blueprintContainer = blueprintContainer; } public void setBlueprintConverter(Converter blueprintConverter) { this.blueprintConverter = blueprintConverter; } public void setActionId(String actionId) { this.actionId = actionId; } @Override public List<Completer> getCompleters() { return completers; } public void setCompleters(List<Completer> completers) { this.completers = completers; } @Override protected ActionPreparator getPreparator() throws Exception { return new ActiveMQActionPreparator(); } class ActiveMQActionPreparator extends DefaultActionPreparator { @Override public boolean prepare(Action action, CommandSession session, List<Object> params) throws Exception { Map<Argument, Field> arguments = new HashMap |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.