Showing posts with label carbon. Show all posts
Showing posts with label carbon. Show all posts

Monday, May 03, 2010

WSO2 Governance Registry, WSO2 Identity Server, WSO2 ESB, WSO2 Web Service Application Server Released

WSO2 has released new versions of their SOA platform products including WSO2 Governance Registry, WSO2 Identity Server, WSO2 ESB, WSO2 Web Service Application Server. This is a major version upgrade of these products introducing many features.


ESB:

  • Priority based mediation through priority executors

  • WS-Discovery support and dynamic endpoint discovery

  • Message Relay for efficient pass through of messages

  • Component manager to install and uninstall features (provisioning support)

  • Common Internet File System (CIFS) support through the VFS transport

  • File locking functionality in the VFS transport to support concurrent polling

  • Smooks mediator for efficient message transformation

  • Enrich mediator for smart message manipulation

  • OAuth mediator for 2-legged OAuth support

  • Default endpoint UI

  • Hot deploy and hot update configuration elements (sequences, endpoints, proxy services etc)

  • Transport level statistics collection and monitoring

  • POX security support

  • Dependency detection and alerting for mediation configuration elements

  • Mediation statistics API and custom mediation statistics consumers

  • Multiple certificate/identity support in the NHTTP transport sender

  • Improved logging capabilities for the NHTTP transport

  • Templates based proxy service development in the UI

  • Dashboard to monitor server environment and runtime

  • Easy creation and management capabilities for dynamic sequences and endpoints

  • Pagination to service management, endpoint management and sequence management UIs

  • Obtaining resources like WSDL's through web proxy servers




Governance Registry

  • Gadgets for impact analysis on services and registry resources

  • WSDL custom view

  • Dynamic Handler configuration

  • Handler simulator

  • Tree-based Resource view

  • API to govern SOA artifacts

  • Complete Web Services API for Registry

  • Improved options for Service discovery

  • WS-Discovery support

  • Scripting support for lifecycle management

  • Improved P2 based provisioning and feature management support

  • Support for adding remote mounts

  • Platform, and Group/Cluster based deployment model

  • Support for multiple server instances

  • E-mail verification for subscriptions

  • Support for deleting tags and comments

  • Support for PostgreSQL and DB2 DBMS

  • Paged activity and resource search

  • Hierarchical permission model with granular and extensible permissions

  • Ability to upload metadata (in addition to importing)

  • Governance Archive for uploading WSDLs and Schemas with imports

  • Ability to update resource content by uploading

  • Rich text editor for editing text resources

  • XML editor for editing handler, lifecycle and service UI configurations




Web Service Application Server (WSO2 WSAS):

  • Component Manager - The UI tool to install/uninstall Carbon featrues.

  • Various bug fixes & enhancements including architectural improvements to Apache Axis2, Apache Rampart, Apache Sandesha2 , WSO2 Carbon & other projects.

  • Equinox P2 based provisioning support - extend your WSAS instance by installin new P2 features. See P2 based provisioning in WSO2 Carbon

  • Hierarchical service support for Axis2 services, JAX-WS services, Spring services & Jar services

  • Report generation for deployed services




Identity Server:

  • SAML 2.0 based Single Sign-on support

  • OAuth Support

  • Support for bulk-user import

  • Various bug fixes and enhancements including architectural improvements to Apache Axis2, Apache Rampart, Apache Sandesha2 , WSO2 Carbon and other projects.

Thursday, January 07, 2010

Writing Business Rules in WSO2 Carbon Platform

If you want to write rules in a Java program you have lot of choices. You can use a third party library like Drools or use the JAVA built-in JSR-94 reference implementation. In WSO2 Carbon, there is a component that abstract the behaviour of different rule engine and give you a unified API. Currently it has plugged into Drools and JAVA built-in JSR-94 implementation.

The rule component in WSO2 Carbon platform mainly used by WSO2 ESB product to mediate messages according to the given business rules. But the component is written to facilitate any requirement of using business rules in WSO2 Carbon platform. I had such a requirement in past few days and manage to use the rule component easily with the help of the component author, indika@wso2.com. So I thought it is worth sharing my experience in here.

Here You will be preparing the following stuff.

1. Rule configuration -

We can use this to provide the information about the rule implementation we are going to use, the rules (You can write rules inline or provide a reference to an external file) and the input and output adapter information.
<configuration xmlns="http://www.wso2.org/products/rule/drools">
<executionSet uri="simpleItemRuleXML">
<source key="file:src/test/resources/rules/simple-rules.drl"/>

<!-- <source>

<x><![CDATA[
rule InvokeABC
// rules inbuilt to the rule conf
end

]]>
</x>
</source> -->
<creation>
<property name="source" value="drl"/>

</creation>
</executionSet>
<session type="stateless"/>
<input name="facts" type="itemData" key="dataContext"></input>

<output name="results" type="itemData" key="dataContext"></output>
</configuration>



2. The Rules  -

You can write rules inline in the above configuration or put it in a file and refer it from a key which can be refered from the ResourceHelper (described below).
import java.util.Calendar;

rule YearEndDiscount
when
$item : org.test.pojo.SimpleItem(price > 100 )

then

Calendar calendar = Calendar.getInstance();
if (calendar.get(Calendar.MONTH) == Calendar.JANUARY) {

$item.setPrice($item.getPrice() * 80/100);
}

end

3. Data Context -

The context object that can be used to feed and retrieve data from and to rule engine. Here is the data context for my application.
public class SimpleDataContext {

public List<NameValuePair> getInput() {

// in reality the data will be retrieve from a database or some datasource
List<NameValuePair> itemPairList = new ArrayList<NameValuePair>();
SimpleItem item1 = new SimpleItem();
item1.setName("item1");
item1.setPrice(50);
itemPairList.add(new NameValuePair(item1.getName(), item1));

SimpleItem item2 = new SimpleItem();
item2.setName("item2");
item2.setPrice(120);
itemPairList.add(new NameValuePair(item2.getName(), item2));

SimpleItem item3 = new SimpleItem();
item3.setName("item3");
item3.setPrice(130);
itemPairList.add(new NameValuePair(item3.getName(), item3));

return itemPairList;
}

public void setResult(Object result) {

if (!(result instanceof SimpleItem)) {
System.out.println("it is not a SimpleItem");
}

SimpleItem item = (SimpleItem)result;
System.out.println("Item: " + item.getName() + ", Price: " + item.getPrice());
}

}

And the Item I'm going to manipulate using rule is a simple bean like this,
public class SimpleItem {
String name;
int price;
public String getName() {

return name;
}

public void setName(String name) {

this.name = name;
}

public int getPrice() {

return price;
}

public void setPrice(int price) {

this.price = price;
}
}

4. Data Adapter

You have to adapt the input and output with the rule engine. Mostly here you only have to wrap the data context. The advantage of having the data adapter is, a data adapter always associated with a input/output type. So in the rule configuration I can provide the type for the input and output. If you see my rule configuration above, you see the input/output type is marked as "ItemData". Here is my custom data adapter that is associated with the "itemData" type.
public class SimpleDataAdapter implements
ResourceAdapter, InputAdaptable, OutputAdaptable {

// the type associated with the adapter
private final static String TYPE = "itemData";
public String getType() {

return TYPE;
}

public Object adaptInput(ResourceDescription resourceDescription, Object tobeadapted) {

if (!(tobeadapted instanceof SimpleDataContext)) {
return null;
}

SimpleDataContext dataContext = (SimpleDataContext)tobeadapted;
return dataContext.getInput();
}

public boolean adaptOutput(ResourceDescription description,
Object value,
Object context,
ResourceHelper resourceHelper) {

if (!(context instanceof SimpleDataContext)) {
return false;
}

((SimpleDataContext)context).setResult(value);
return true;
}

public boolean canAdapt(ResourceDescription description, Object ouptput) {
String key = description.getKey();
return key != null && !"".equals(key);
}

}

5. Resource Helper

Resource Helper will map the keys refered from the configuration to JAVA objects. This is mostly used in mediation rule configurations which can extract the message data using a key or an xpath. In this example, we don't have much keys refering from the configuration only the rule file and the data context.
public class SimpleResourceHelper extends ResourceHelper {

public ReturnValue findByKey(String key, Object source, Object defaultValue) {

if (!(source instanceof SimpleDataContext)) {
return new ReturnValue(defaultValue);
}

SimpleDataContext dataContext = (SimpleDataContext)source;
if (key.startsWith("file:")) {

String filename = key.substring("file:".length());
try {

BufferedInputStream in = new BufferedInputStream(new FileInputStream(filename));
return new ReturnValue(in);
} catch (Exception e) {

return new ReturnValue(defaultValue);
}
}
if (key.startsWith("dataContext")) {

return new ReturnValue(dataContext);
}
return new ReturnValue(defaultValue);
}

// there are few more methods to be implemented, which can just leave not implemented for this example
}
}

That is all the accessories. Now you will be able to write the rule engine execution code.
File ruleConfigFile = new File(ruleConfigFilename);
XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream(ruleConfigFile));

//create the builder
StAXOMBuilder builder = new StAXOMBuilder(parser);
//get the root element (in this case the envelope)

OMElement ruleConfig = builder.getDocumentElement();
EngineConfiguration configuration =
new EngineConfigurationFactory().create(ruleConfig, new AXIOMXPathFactory());

EngineController
engineController = new EngineController(configuration, new SimpleResourceHelper());
final ResourceAdapterFactory factory = ResourceAdapterFactory.getInstance();

ResourceAdapter adapter = new SimpleDataAdapter();
String adapterType = adapter.getType();
if (!factory.containsResourceAdapter(adapterType)) {

factory.addResourceAdapter(adapter);
}

SimpleDataContext simpleContext = new SimpleDataContext();

if (!engineController.isInitialized()) {
engineController.init(simpleContext);

}

if (engineController.isInitialized()) {
engineController.execute(simpleContext, simpleContext);

}

Tuesday, October 13, 2009

WSO2 SOA Workshop 2009, Santa Clara, CA

WSO2 is hosting a SOA Workshop in Santa Clara, California in November 3rd 2009. You will be able to attend to the following sessions covered by the industry leading experts in SOA.

  • ESBS and SOA

  • SOA Security

  • Mashups and Business Process Management for SOA

  • SOA Governance

  • SOA with C, C++, PHP

  • SOA Architecture Pattern


Visit here to find more details about the event, http://wso2.com/events/2009-us-soa-workshop/?soaotad=10072009

WSO2 Releases Goernance Registry 3.0.1, ESB 2.1.1, WSAS 3.1.1, IS 2.0.1 AND Mashup Server 2.0.0

WSO2 announced an another round of release of their famous SOA products.

Although the version numbers say this is minor patch release (Other than the Mashup Server which is shipping as a major release), in fact there are new features and improvements. Some basic new features shares among all of these products are

  1. Improved registry level transaction Support.

  2. Improved Support for deploying on top of Application Servers other than tomcat like WebSphere, WebLogic, and
    JBoss.

  3. Support for Eclipse P2 based provisioning. (Yes, you can add/remove features from these WSO2 products , see https://wso2.org/wiki/display/carbon/p2-based-provisioning-support for more details)

  4. Improved Remote Registry model

Saturday, July 11, 2009

WSO2 Carbon 2 - WSAS, ESB & Governance Registry Released

WSO2 -An open source middleware company- announced the release of bunch of their SOA enabling products along with Carbon 2.0.0 which is an OSGI based unified platform that all the WSO2 java products are built on.

  • WSAS (Web Service Application Server) - Provide and consume web services, data services with full WS-*, REST support, GUI tools, Integration with Eclipse, etc..

  • ESB (Enterprise Service Bus) - Message routing, mediation, transformation, logging, task scheduling, load balancing, failover routing, event brokering, etc. with number of transports support

  • Governance Registry - Govern you SOA platform, introducing number of new features including Dashboard with Gadgets, lifecycle management with checklists, eventing and notifications, remote/symbolic links, checkin/checkout functionality and new meta data management UI.


You will be able to get the advantage of the carbon platform by extending the functionality of any of these products, just by mixing components from other products (Just like running an ESB within WSAS).

Download, Play around with them and Enjoy:)!!!