Before
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij6YAew6_fQSok6qFaKEZSgReACMQMhytDpes5GPa_KJWwoQwnURadFlNBEJseG4atKCdVHXoT2pPPKReKso86PnWwpGZnGek9Fz0rdLf7yZe7tfItsdmAY6c2XdmV8tIHgwagWz6C_BU/s320/org_before.png)
After
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJGqPldr0ZxCf_QI0iLCZMKRhOCBC8v7KZMVX5mVZR6yquJ2j_e_sfYF474w1gFae0ngqhSnUE9629Bvix5E1ycQ50ZOUZiwrhbd70hO8sn1zUD2l86gznTZAQw08uDvyHKyPNMDmx9Ik/s320/console.png)
[domain@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:read-resource
{
"outcome" => "success",
"result" => {
"connection-url" => "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1",
"driver-name" => "h2",
"enabled" => true,
"jndi-name" => "java:jboss/datasources/ExampleDS",
"jta" => true,
"password" => "sa",
"use-ccm" => true,
"user-name" => "sa",
}
}
@Address("/subsystem=datasources/data-source={0}")
public interface DataSource {
@Binding(detypedName = "jndi-name")
String getJndiName();
void setJndiName(String name);
@Binding(detypedName = "user-name")
String getUsername();
void setUsername(String user);
String getPassword();
void setPassword(String password);
[...]
}
// Create an EntityAdapter for a specific type
EntityAdapteradapter = new EntityAdapter (DataSource.class, metaData);
// Convert from entity to DMR representation
DataSource datasource = ...;
ModelNode operation = adapter.fromEntity(datasource);
// execute the operation (HTTP request) ...
// Create an EntityAdapter for a specific type
EntityAdapteradapter = new EntityAdapter (DataSource.class, metaData);
ModelNode detyped = ...; // HTTP response
// Convert form DMR to entity
DataSource datasource = adapter.fromDMR(detyped);
// Work on the entity ....
/subsystem=datasources/data-source=ExampleDS
AddressBinding address = metaData.getBeanMetaData(DataSource.class).getAddress();
ModelNode operation = address.asSubresource("ExampleDS");
// further specify the operation (OP, RECURSIVE,ETC)
operation.get(OP).set(READ_RESOURCE);
// execute the operation (HTTP request) ...
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<users>
<user username="admin">
<password>
password
</password>
</user>
</users>
</authentication>
</security-realm>
</security-realms>
</management>
<management-interfaces>
<native-interface interface="public" port="9999"/>
<http-interface interface="public"
port="9990" security-realm="ManagementRealm"/>
</management-interfaces>
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<users>
<user username="admin">
<password>password</password>
</user>
</users>
</authentication>
</security-realm>
</security-realms>
</management>
<management-interfaces>
<native-interface interface="default" port="9999"/>
<http-interface interface="default"
port="9990" security-realm="ManagementRealm"/>
</management-interfaces>
The work on management use cases that relate to subsystems has not begun yet. There are merely two examples (Datasource and JMS) that act as a preview and should give you an idea where things are going.
You want to contribute to the management web interface for JBoss ? Then this should get you going.
CodebaseThe console it self is developed using the Google Web Toolkit. You would need to make yourself familiar with the basics before we et going. The GWT SDK will be installed as part of the maven build. No need to fetch it on it's own. If you plan to work with Eclipse, then you should consider the development tools for GWT that are provided by Google. But please don't ask how things are setup correctly in Eclipse. We baseline on maven and that's it.
Widgets
We build on GWT 2.2 without any dependencies on external widget libraries. However these is a growing number of widgets (org.jboss.as.console.client.widgets) that should be reused. We aim for keeping the overall number of widgets to a minimum.
But if you need anything that doesn't exist, take a look at the SmartGWT showcase, tell us about it and we'll then consider implementing it.
MVP Pattern
But one of the cornerstones is the GWT Platform library, which nicely abstracts the MVP pattern. It act's as a blueprint for the console design. A good introduction can be found here. (This is a "must read")
AutoBeans
Internal model representations are build as AutoBean's. They align well with the default GWT API and have build-in serialization support. A general guideline: Any domain representation that's used within the console needs to be provided as an AutoBean abstraction. This means that beyond the integration layer (backend calls to the AS 7 domain) entities need to be adopted.
This is necessary to provide a baseline for the data binding used across widgets. Take a look at the form abstractions, then you'll know what I mean. The CellList and CellTable API's are another example.