b站账号封禁查询被封禁了,怎么解封?

Apache&Felix&学习笔记
最近在学习OSGI,在Apache Felix和Eclipse equinox两个实现中选了Felix开始学习。
2. 启动felix
bin/felix.jar
[root@rhel64 felix-framework-4.2.1]# java -jar
bin/felix.jar
____________________________
Welcome to Apache Felix Gogo
START LEVEL 1
ID|State&&&&&
|Level|Name
0|Active&&&&
|&&& 0|System
Bundle (4.2.1)
1|Active&&&&
|&&& 1|Apache
Felix Bundle Repository (1.6.6)
2|Active&&&&
|&&& 1|Apache
Felix Gogo Command (0.12.0)
3|Active&&&&
|&&& 1|Apache
Felix Gogo Runtime (0.10.0)
4|Active&&&&
|&&& 1|Apache
Felix Gogo Shell (0.10.0)
3. 退出felix
4. 缺省的Bundle安装(cache)目录
./felix-framework-4.2.1/felix-cache
可以通过java -jar
bin/felix.jar
&cache-path&
指定cache目录
5. 安装bundle
g! felix:install
file:/mnt/hgfs/pub/org.apache.servicemix.bundles.protobuf-java-2.4.1_1.jar
Bundle ID: 6
START LEVEL 1
ID|State&&&&&
|Level|Name
0|Active&&&&
|&&& 0|System
Bundle (4.2.1)
1|Active&&&&
|&&& 1|Apache
Felix Bundle Repository (1.6.6)
2|Active&&&&
|&&& 1|Apache
Felix Gogo Command (0.12.0)
3|Active&&&&
|&&& 1|Apache
Felix Gogo Runtime (0.10.0)
4|Active&&&&
|&&& 1|Apache
Felix Gogo Shell (0.10.0)
&&& 6|Installed&
|&&& 1|Apache
ServiceMix :: Bundles :: protobuf-java (2.4.1.1)
6.启动bundle
g! start 6
START LEVEL 1
ID|State&&&&&
|Level|Name
0|Active&&&&
|&&& 0|System
Bundle (4.2.1)
1|Active&&&&
|&&& 1|Apache
Felix Bundle Repository (1.6.6)
2|Active&&&&
|&&& 1|Apache
Felix Gogo Command (0.12.0)
3|Active&&&&
|&&& 1|Apache
Felix Gogo Runtime (0.10.0)
4|Active&&&&
|&&& 1|Apache
Felix Gogo Shell (0.10.0)
&&& 6|Active&&&&
|&&& 1|Apache
ServiceMix :: Bundles :: protobuf-java (2.4.1.1)
<font COLOR="#.
停止bundle
g! stop 6&
START LEVEL 1
ID|State&&&&&
|Level|Name
0|Active&&&&
|&&& 0|System
Bundle (4.2.1)
1|Active&&&&
|&&& 1|Apache
Felix Bundle Repository (1.6.6)
2|Active&&&&
|&&& 1|Apache
Felix Gogo Command (0.12.0)
3|Active&&&&
|&&& 1|Apache
Felix Gogo Runtime (0.10.0)
4|Active&&&&
|&&& 1|Apache
Felix Gogo Shell (0.10.0)
6|Resolved&&
|&&& 1|Apache
ServiceMix :: Bundles :: protobuf-java (2.4.1.1)
8. 打印帮助
felix:bundlelevel
felix:frameworklevel
felix:headers
felix:help
felix:inspect
felix:install
felix:refresh
felix:resolve
felix:start
felix:stop
felix:uninstall
felix:update
felix:which
gogo:format
gogo:getopt
gogo:source
gogo:telnetd
gogo:until
obr:deploy
obr:javadoc
obr:source
g! help felix:stop
stop - stop bundles
&& scope: felix
-t, --transient&& stop bundle
transiently
&& parameters:
Bundle[]&& target bundles
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Apache Felix - Apache Felix Web Console
&&raquo&&&raquo&
Apache Felix Web Console
The Apache Felix Web Console is a simple tool to inspect and manage OSGi framework instances using your favourite Web Browser.
Requirements
The Web Console only has a single required dependency on the framework: A running implementation of the OSGi Http Service Specification. The reason for this is, that the Web Console is implemented as a servlet (actually just a gateway servlet dispatching to Web Console plugins) which is registered with the Http Service. If your framework does not yet have a Http Service installed, you might select from a variety of such implementations. The following is just an incomplete list:
Apache Felix HTTP Service. This is a very basic implementation of the OSGi Http Service based on Jetty 6.1.7. The Apache Felix HTTP Service has not been released yet, so you would have to build it yourself.
PAX Web Service. The PAX Web Service is the basis for a whole range of additions from the
project. The PAX Web Service is also based on Jetty 6 and may be dowloaded from the [OPS4J PAX Web|http://wiki.ops4j.org/confluence/display/ops4j/Pax+Web] page.
Equinox HTTP Service implementation. You can get more information on the Equinox implementation from the
Apart from that Web Console has the following dependencies, which do not need to be satisfied. In this case the respective functionality is just missing.
OSGi Log Service -- The Log Service is used for logging. If the service is not available the Web Console prints logging to the standard output
OSGi Configuration Admin Service and OSGi Metatype Service -- The Configuration Admin and Metatype services are used to support simple form based configuration administration
Apache Felix Declarative Services -- If your framework uses the Apache Felix Declarative Services implementation, you can use to the Web Console to inspect the declared components available from the various bundles and managed by the Service Component Runtime.
Note, that the Apache Felix Declarative Services implementation is the only Apache Felix dependency contained in the Web Console. If you do not use the Apache Felix Declarative Services implementation, you just cannot inspect the declared components (because there is no official public API for this). Otherwise the Web Console perfectly operates without any problems.
The Web Console Bundle is available in two variants: A full variant and a bare variant. The full variant embeds three Java libraries which are not embedded in the bare variant. The bare variant expects the packages provided by those libraries to be exported from bundles installed in the framework.
The three libraries are :
Apache Commons IO
Apache Commons FileUpload
Version 2.0.6 is the first release providing a bare variant. In this release both variants have the same symbolic name but a different file name: org.apache.felix.webconsole-2.0.6.jar for the full variant and org.apache.felix.webconsole-2.0.6-bare.jar for the bare variant. This is
and will be fixed in the next release as follows:
Full variant symbolic name: org.apache.felix.webconsole
Bare variant symbolic name: org.apache.felix.webconsole.bare
Installation
To install just use your favourite current means of installing new bundles in to the OSGi framework. For example using the Apache Felix shell console you might do:
& install http://mirror.switch.ch/mirror/apache/dist/felix/org.apache.felix.webconsole-2.0.6.jar
where x is the bundle number printed by the Shell Console indicating the Bundle ID of the Web Console bundle.
Configuration
The configuration of the Web Console consists of two parts: One part is the configuration of the Http Service defining at which host address (host and port number) the servlet container is accessible. This configuration is technically outside of the scope of the Web Console configuration. See below for more information and how this is influenced.
The second part of the Web Console configuration is the configuration of the console itself. The Web Console is configured using the OSGi Configuration Admin Service in that the Web Console registered a ManagedService with Service PID org.apache.felix.webconsole.internal.servlet.OsgiManager (of course you may well use the Web Console to edit the configuration of the Web Console itself).
The Web Console supports the following settings with their corresponding default values:
Default Value
Description
manager.root
/system/console
The root path to the OSGi Management Console.
default.render
The name of the default configuration page
when invoking the OSGi Management console.
OSGi Management Console
The name of the HTTP Authentication Realm.
The name of the user allowed to access the OSGi Management Console. To disable authentication clear this value.
The password for the user allowed to access the OSGi Management Console.
all plugins enabled
The labels of the plugins enabled and displayed.
Log level filter for the AbstractWebConsole log methods. This is an integer value matching the levels defined by the OSGi Log Service.
If set, this locale forces the localization to use this locale instead of the one requested by the web browser.
The default values apply if the respective property is missing from the configuration or if no configuration is provided at all.
Framework Properties
Some of the configuration properties supported through the OSGi Configuration Admin service can also be set globally and statically as framework properties. Such framework properties will also be considered actual default values for missing properties in Configuration Admin configuration as well as for the Metatype descriptor.
Framework Property
Configuration Admin Property
felix.webconsole.manager.root
manager.root
felix.webconsole.realm
felix.webconsole.username
felix.webconsole.password
felix.webconsole.loglevel
felix.webconsole.locale
Please note that setting any of these properties as framework property makes them visible to all bundles deployed. This is particularly to be considered in case of the felix.webconsole.password property (as for authentication, the use of a
is suggested anyway).
Configuration of the OSGi Http Service
As said above, the configuration of the OSGi Http Service used by the Web Console to register itself is outside of the scope of the Web Console. Lets just say, the OSGi Http Service specification defines a system propety -- org.osgi.service.http.port -- which may be set to define the port at which the Http Service should listen for HTTP requests. The respective Http Service implementation may define additional properties to define the actual interface on which to listen or to define a servlet context path.
By default it is probably safe to assume, that having set the org.osgi.service.http.port to a defined value, the Http Service implementation will listen on all interfaces for requests at the set port number and that no servlet context path actually exists. For example, given the org.osgi.service.http.port property is set to 8888 the Web Console in the local system can be reached at : http://localhost:8888/system/console, where the /system/console path is configured using the manager.root configuration property (see the Configuration section).
If you happen to deploy an OSGi framework instance inside a traditional web application and thus the Http Service implementation is actually a bridge into the existing servlet container (see for example
or the Apache Sling Launchpad Web application), the host, port and context path are defined by your servlet container and web application deployment. For example, if the servlet container listens on host sample.org at port 8888 and the web application with your OSGi container is available in the /osgi context, the Web Console would be accessible at http://sample.org:8888/osgi/system/console.
Configuration Manager
The Configuration Manager is available via http://localhost:8888/system/console/configMgr. It display all OSGi services which can be configured.
Configuration factories
The Configuration Manager has special support for configuration factories by allowing to add new items via the "plus" buttons or editing or removing existing ones.
By default for each confguration factory item a unique ID is displayed, which is quite cryptic. Example: org.apache.felix.jaas.Configuration.factory.18a6be2a-f56-77fabff7b7ea.
The developer of the service with configuration factory can define a special "name hint" configuration propery which defines a name template which is used to build the configuration factory item name when displayed in the Configuration Manager. The name of this property is webconsole.configurationFactory.nameHint. It allows referencing other service property names as placeholders by enclosing in brackets.
webconsole.configurationFactory.nameHint = "{jaas.realmName}, {jaas.classname}"
jaas.realmName = "myRealm"
jaas.classname = "myClass"
In this case the Configuration Manager displays the name "myRealm, myClass" as display name for the configuration entry which is much more human-readable than the cryptic name. Please not that the OSGi configuration property webconsole.configurationFactory.nameHint must not be set to "private". It is never displayed by the Configuration Manager.
The Web Console only has very basic security at the moment supporting only HTTP Basic authentication. This security is enabled by default and may be disabled by simply clearing the username property.
To enhance the security of the Web Console you strongly encouraged to change at least the password for the admin user.
As of Web Console 3.1.0 this simple user setup can be extended by providing . See that page for more information.
Browser Compliance
The goal of the Web Console is to support as big a range of Web Browsers as possible. As it stands now, Firefox (versions 2 and 3), Opera and Internet Explorer (versions 6 and 7) seem to be capable of using the Web Console. Should you encounter any problems with your particular browser, please report an issue for the Web Console in our issue tracking system ().
Beginning with Release 1.2.8 the Web Console is using JQuery to enhance the user experience. This should also help in keeping browser support on the broadest possible basis.
Extending the Web Console
The Web Console can be extended by registering an OSGi service for the interface javax.servlet.Servlet with the service property felix.webconsole.label set to the label (last segment in the URL) of the page. The respective service is called a Web Console Plugin or a plugin for short.
Please for to the
for full documentation on extending the Apache Felix Web Console.
RESTful API
While the Web Console does not have a full featured and documented REST-ful API, most plugins try to follow REST approaches. For example the Bundles plugin is able to send information on all bundles or a single directly addressed bundle.
An attempt is made to document the current state of REST-like APIs at
Should you have any questions using the Web Console, please send a note to one of our .
Please report any issues with the Web Console in our issue tracking system () and be sure to report for the Web Console component. See our [Issue Tracking] page for more details.
Screenshots
| !console-bundles.png|thumbnail! | !console-bundles-details.png|thumbnail! | !console-components.png|thumbnail! |
| Bundle List | Bundle Details | Declarative Services Components (requires Apache Felix SCR) |
| !console-config.png|thumbnail! | !console-status.png|thumbnail! | !console-system-info.png|thumbnail! |
| Configuration Admin | System Status | System Information |在Apache Felix中运行bundle -
- ITeye技术网站
博客分类:
在前面搭建了一个Apache Felix的运行环境,下面就写一个简单的bundle,测试测试。
1、新建一个插件工程,如下图:
点击下一步。
2、给插件工程命名一个名字,这里叫pig1。This plug-in is targeted to run with中选择an OSGI framework --&standard,如下图红框中所示:
点击下一步。
3、bundle中有一个启动类,默认是Activator,相当于普通工程中的Main类。你也可以把它更改成其他名字,这里使用默认的名字。如下图:
点击下一步。
4、去掉Create a plug-in using one of the templates,如下图:
点击Finish。
5、插件工程建好后,打开Activator类,可以看到里面有一个start方法和一个stop方法,可以在bundle启动和停止的时候做一些事情。这里只是简单地输出一个字符串,作为bundle启动和停止时的标识。
* (non-Javadoc)
* org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
public void start(BundleContext bundleContext) throws Exception
Activator.context = bundleC
System.out.println("start pig1");
* (non-Javadoc)
* org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
public void stop(BundleContext bundleContext) throws Exception
Activator.context =
System.out.println("stop pig1");
6、代码也写好后,就可以导出插件工程发布了。如何让这个工程作为一个bundle被部署到Felix容器中呢?右击插件工程pig1,选择Export。可看下图:
出现Export视图之后,选择Plug-in Development下的Deployable plug-ins and fragments,如下图:
点击下一步,选择要导出的插件,Destination选项卡的Directory选择我们的Felix环境的物理地址,导出后,会在Felix工程的根目录自动创建一个plugins目录,bundle会默认导出这个目录。如下图:
点击Finish,你就可以看到Felix工程下面多了一个plugins目录,我们所导出的bundle就在里面,如下图:
7、接着就是安装、运行了。
有三种方法可以安装、运行一个bundle。
(1)使用命令。
首先,启动Felix,在Console中先使用install命令安装bundle,接着使用start命令启动bundle,如下图:
启动的时候,start命令后接着那个bundle的启动ID就可以启动bundle了,如上图的12。
可以看到,当启动bundle的时候,输出了Activator类中start方法的输出语句,即"start pig1"。
Pig1的状态为Active,说明bundle启动成功了。
当然,你也可以使用uninstall命令卸载一个bundle,用法如install命令。
(2)使用Felix配置文件,打开conf/config.properties,如下图:
打开config.properties,找到felix.auto.start.1参数,值写成file:plugins/pig1_1.0.0..jar,如:
(如果你有多个bundle,之间用空格隔开)。
# The following property is a space-delimited list of bundle URLs
# to install and start when the framework starts. The ending numerical
# component is the target start level. Any number of these properties
# may be specified for different start levels.
felix.auto.start.1=file:plugins/pig1_1.0.0..jar
参数写好后,启动Felix,你就可以看到bundle Pig1自动安装并启动了,如下图所示:
(3)第三种方法就是使用File Install了,使用Apache Felix的File Install bundle,我们可以安装和启动bundle而无需启动Felix,这个将在下面的章节中讲解。
8、OK,完成了。
浏览: 118215 次
来自: 南京
你知道 Component可以当注解使用吗?像这样@Compo ...
/2013/08/java ...
/2013/08/java ...

我要回帖

更多关于 b站账号封禁 的文章

 

随机推荐