use of lucee.runtime.type.scope.Cluster in project Lucee by lucee.
the class ConfigServerImpl method createClusterScope.
/*private static long _countx(ConfigWebImpl config) {
long count=0;
count+=_count(config.getMappings());
count+=_count(config.getCustomTagMappings());
count+=_count(config.getComponentMappings());
count+=_count(config.getFunctionMapping());
count+=_count(config.getServerFunctionMapping());
count+=_count(config.getTagMapping());
count+=_count(config.getServerTagMapping());
//count+=_count(((ConfigWebImpl)config).getServerTagMapping());
return count;
}*/
/*private static long _count(Mapping[] mappings) {
long count=0;
for(int i=0;i<mappings.length;i++){
count+=_count(mappings[i]);
}
return count;
}*/
/*private static long _countx(Mapping mapping) {
PCLCollection pcl = ((MappingImpl)mapping).getPCLCollection();
return pcl==null?0:pcl.count();
}*/
@Override
public Cluster createClusterScope() throws PageException {
Cluster cluster = null;
try {
if (Reflector.isInstaneOf(getClusterClass(), Cluster.class)) {
cluster = (Cluster) ClassUtil.loadInstance(getClusterClass(), ArrayUtil.OBJECT_EMPTY);
cluster.init(this);
} else if (Reflector.isInstaneOf(getClusterClass(), ClusterRemote.class)) {
ClusterRemote cb = (ClusterRemote) ClassUtil.loadInstance(getClusterClass(), ArrayUtil.OBJECT_EMPTY);
cluster = new ClusterWrap(this, cb);
// cluster.init(cs);
}
} catch (Exception e) {
throw Caster.toPageException(e);
}
return cluster;
}
use of lucee.runtime.type.scope.Cluster in project Lucee by lucee.
the class Admin method _doSetCluster.
private void _doSetCluster() throws PageException {
Struct entries = Caster.toStruct(getObject("admin", action, "entries"));
Struct entry;
Iterator<Object> it = entries.valueIterator();
Cluster cluster = pageContext.clusterScope();
while (it.hasNext()) {
entry = Caster.toStruct(it.next());
cluster.setEntry(new ClusterEntryImpl(KeyImpl.getInstance(Caster.toString(entry.get(KeyConstants._key))), Caster.toSerializable(entry.get(KeyConstants._value, null), null), Caster.toLongValue(entry.get(KeyConstants._time))));
}
cluster.broadcast();
}
Aggregations