Skip to content

Commit

Permalink
[bndtools] blade.gogo
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyWu2015 committed Dec 22, 2015
1 parent 578b1d0 commit e41b6ce
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bndtools/blade.gogo/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
<classpathentry kind="output" path="bin"/>
</classpath>
23 changes: 23 additions & 0 deletions bndtools/blade.gogo/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>blade.gogo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>bndtools.core.bndbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>bndtools.core.bndnature</nature>
</natures>
</projectDescription>
7 changes: 7 additions & 0 deletions bndtools/blade.gogo/bnd.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-buildpath: \
osgi.cmpn;version=5.0,\
com.liferay.portal:portal-service;version='[7.0,8)'

Bundle-Version: 1.0.0.${tstamp}

Private-Package: blade.gogo
46 changes: 46 additions & 0 deletions bndtools/blade.gogo/src/blade/gogo/UserCountCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright 2000-present Liferay, Inc.
*
* Licensed 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 blade.gogo;

import com.liferay.portal.service.UserLocalService;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;


@Component(
property = {
"osgi.command.scope=blade",
"osgi.command.function=usercount"
},
service = Object.class
)
public class UserCountCommand {
private UserLocalService _userLocalService;

public void usercount() {
System.out.println("# of users: " + getUserLocalService().getUsersCount());
}

public UserLocalService getUserLocalService() {
return _userLocalService;
}

@Reference
public void setUserLocalService(UserLocalService _userLocalService) {
this._userLocalService = _userLocalService;
}
}

0 comments on commit e41b6ce

Please sign in to comment.