Custom functional types

Previous Next

You can define custom functional types in addition to the ones provided by USoft. A functional type is a name that you can specify for reusable code. It is based on the concept of inheritance in Java. The existing code may be:

a class or structure that you have created in Service Definer.

a class or interface from the Java libraries delivered with USoft Service Framework.

a class or interface from an external Java library (not delivered by USoft).

Creating a custom functional type

1.Choose Define, Functional Types from the USoft Service Definer menu.
The Functional Types window appears.
2.Specify a name in the Functional Type field. This is the name that you can use in the Services/Classes window as Functional Type for a service/class.
3.Specify either a Super Class Name, a Base Class Name, or Implemented Interfaces Names.
Specify a Super Class Name (including a namespace) if the reusable code is a Java class, Service Framework class or structure, and each time you use it you want USoft Service Framework to create a new class that inherits from it.
Example
In this example, ReservationEvent is a structure defined in Service Definer that holds common fields for different message events available for a reservation in a travel agency event processing system. See the reservation event example

com.usoft.service.ReservationEvent

 

Specify a Base Class Name ( including a namespace ) if the reusable code is a Java class, Service Framework class or structure, and each time you use it you want USoft Service Framework to make a copy of the existing class and extend it.
Example

com.usoft.service.ReservationEvent

 

Specify Implemented Interfaces Names if the reusable code is a collection of Java interfaces and you want to inherit from them. Supply a semicolon-separated list of Java interfaces (including namespaces) here. See the log REST request example.
Example

javax.ws.rs.container.ContainerRequestFilter

4.Choose the Class Type where this Functional Type may be used.

 

See also

Functional types

Example: Reservation event functional type

Example: Custom authentication for REST services