File: EventingBuilder.java

package info (click to toggle)
libjboss-web-services-java 0.0%2Bsvn5660%2Bdak2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,252 kB
  • ctags: 12,475
  • sloc: java: 79,207; xml: 29; makefile: 19; sh: 16
file content (46 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.jboss.ws.extensions.eventing.mgmt;

import java.net.URI;
import java.net.URISyntaxException;

import org.jboss.ws.WSException;
import org.jboss.ws.extensions.eventing.EventingConstants;
import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDeployment;

/**
 * @author Heiko Braun, <heiko@openj.net>
 * @since 24-Jan-2006
 */
public class EventingBuilder
{

   private EventingBuilder()
   {
   }

   public static EventingBuilder createEventingBuilder()
   {
      return new EventingBuilder();
   }

   public EventSource newEventSource(EventingEndpointDeployment desc)
   {
      URI eventSourceNS = newEventSourceURI(desc.getName());
      EventSource eventSource = new EventSource(desc.getName(), eventSourceNS, desc.getSchema(), desc.getNotificationRootElementNS());
      eventSource.getSupportedFilterDialects().add(EventingConstants.getDefaultFilterDialect());
      return eventSource;
   }

   public URI newEventSourceURI(String name)
   {
      try
      {
         return new URI(name);
      }
      catch (URISyntaxException e)
      {
         throw new WSException("Failed to create eventsource URI: " + e.getMessage());
      }
   }

}