KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > maven > plugin > jbi > AbstractDeployableMojo


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.maven.plugin.jbi;
18
19 import org.apache.servicemix.jbi.management.task.JbiTask;
20 import org.apache.tools.ant.Project;
21
22 public abstract class AbstractDeployableMojo extends AbstractJbiMojo {
23
24     /**
25      * @parameter default-value="rmi"
26      */

27     private String JavaDoc serverProtocol;
28
29     /**
30      * @parameter default-value="localhost"
31      */

32     private String JavaDoc host;
33
34     /**
35      * @parameter default-value="ServiceMix"
36      */

37     private String JavaDoc containerName;
38
39     /**
40      * @parameter default-value="org.apache.servicemix"
41      */

42     private String JavaDoc jmxDomainName;
43
44     /**
45      * @parameter default-value="1099"
46      */

47     protected String JavaDoc port;
48
49     /**
50      * @parameter default-value="/jmxrmi"
51      */

52     private String JavaDoc jndiPath;
53
54     /**
55      * @parameter default-value="smx"
56      */

57     private String JavaDoc username;
58
59     /**
60      * @parameter default-value="smx"
61      */

62     private String JavaDoc password;
63
64     protected JbiTask initializeJbiTask(JbiTask task) {
65         
66         Project antProject = new Project();
67         antProject.init();
68         task.setProject(antProject);
69         
70         task.setContainerName(containerName);
71         task.setHost(host);
72         task.setServerProtocol(serverProtocol);
73         task.setJmxDomainName(jmxDomainName);
74         task.setPort(Integer.parseInt(port));
75         task.setJndiPath(jndiPath);
76         task.setUsername(username);
77         task.setPassword(password);
78         
79         task.setTaskName("JBITask");
80         task.setTaskType("JBITask");
81         return task;
82     }
83
84 }
85
Popular Tags