01: package org.bpmscript.web;
02:
03: import java.util.UUID;
04:
05: import org.springframework.beans.factory.FactoryBean;
06:
07: public class ClusterNameFactoryBean implements FactoryBean {
08:
09: private String prefix = null;
10:
11: public Object getObject() throws Exception {
12: String uuid = UUID.randomUUID().toString();
13: if (prefix != null) {
14: return prefix + uuid;
15: } else {
16: return uuid;
17: }
18: }
19:
20: public Class getObjectType() {
21: return String.class;
22: }
23:
24: public boolean isSingleton() {
25: return false;
26: }
27:
28: public String getPrefix() {
29: return prefix;
30: }
31:
32: public void setPrefix(String prefix) {
33: this.prefix = prefix;
34: }
35:
36: }
|