rhmessaging commits: r3207 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-24 14:50:37 -0400 (Tue, 24 Mar 2009)
New Revision: 3207
Modified:
mgmt/trunk/cumin/python/cumin/action.py
mgmt/trunk/cumin/python/cumin/action.strings
Log:
Convert the actions page to use HtmlPage
Modified: mgmt/trunk/cumin/python/cumin/action.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/action.py 2009-03-24 17:35:17 UTC (rev 3206)
+++ mgmt/trunk/cumin/python/cumin/action.py 2009-03-24 18:50:37 UTC (rev 3207)
@@ -1,4 +1,5 @@
from wooly import *
+from wooly.pages import *
from wooly.tables import *
from datetime import datetime
@@ -59,7 +60,7 @@
def do_get_items(self, session, *args):
return reversed(sorted_by(self.app.model.invocations, "when"))
-class ActionPage(Page):
+class ActionPage(HtmlPage):
def __init__(self, app, name):
super(ActionPage, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/action.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/action.strings 2009-03-24 17:35:17 UTC (rev 3206)
+++ mgmt/trunk/cumin/python/cumin/action.strings 2009-03-24 18:50:37 UTC (rev 3207)
@@ -6,22 +6,7 @@
<tbody>{items}</tbody>
</table>
-[ActionPage.html]
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
- <head>
- <title>{title}</title>
- <meta http-equiv="refresh" content="3"/>
- <link rel="stylesheet" type="text/css" href="cumin.css"/>
- <link rel="shortcut icon" href="resource?name=favicon.ico" type="image/x-icon"/>
- </head>
- <style>
- body {
- padding: 1em;
- }
- </style>
- <body>
- {actions}
- </body>
-</html>
+[ActionPage.css]
+body {
+ margin: 1em;
+}
15 years, 9 months
rhmessaging commits: r3206 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-24 13:35:17 -0400 (Tue, 24 Mar 2009)
New Revision: 3206
Modified:
mgmt/trunk/wooly/python/wooly/__init__.py
mgmt/trunk/wooly/python/wooly/server.py
Log:
Only produce Set-Cookie headers for newly set cookies.
Replace the per-cookie Session.marshal_cookie with marshal_cookies,
which returns a list and filters down to newly set cookies only.
Add doc strings!
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-23 21:57:31 UTC (rev 3205)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-24 17:35:17 UTC (rev 3206)
@@ -472,7 +472,7 @@
self.origin = None
self.values_by_path = dict()
- self.cookies_by_name = dict() # name => (value, expires)
+ self.cookies_by_name = dict() # name => (newly set?, value, expires)
self.headers_by_name = dict()
if self.app.debug:
@@ -507,12 +507,12 @@
def get_cookie(self, name):
try:
- return self.cookies_by_name[name][0]
+ return self.cookies_by_name[name][1]
except KeyError:
pass
def set_cookie(self, name, value, expires=None):
- self.cookies_by_name[name] = (value, expires)
+ self.cookies_by_name[name] = (True, value, expires)
def expire_cookie(self, name):
self.set_cookie(name, "", datetime(*gmtime(1)[0:6]))
@@ -632,22 +632,43 @@
except ValueError:
pass
- def marshal_cookie(self, name):
- value, expires = self.cookies_by_name[name]
+ def marshal_cookies(self):
+ """
+ Produce a list of strings representing cookies newly set on
+ this session.
- crumbs = list()
- crumbs.append("%s=%s" % (name, value))
+ The strings are formatted to serve as HTTP Set-Cookie header
+ values.
+ """
- if expires:
- when = expires.strftime(self.http_date_gmt)
- crumbs.append("expires=%s" % when)
+ headers = list()
- return "; ".join(crumbs)
+ for name, record in self.cookies_by_name.iteritems():
+ new, value, expires = record
+ if new:
+ crumbs = list()
+ crumbs.append("%s=%s" % (name, value))
+
+ if expires:
+ when = expires.strftime(self.http_date_gmt)
+ crumbs.append("expires=%s" % when)
+
+ headers.append("; ".join(crumbs))
+
+ return headers
+
def unmarshal_cookies(self, string):
+ """
+ Parse and load cookies from string.
+
+ The string must be formatted as dictated by the HTTP Cookie
+ header.
+ """
+
for crumb in string.split(";"):
name, value = crumb.split("=", 1)
- self.cookies_by_name[name.strip()] = (value.strip(), None)
+ self.cookies_by_name[name.strip()] = (False, value.strip(), None)
def set_origin(self, origin):
self.origin = self.fix_origin(origin)
Modified: mgmt/trunk/wooly/python/wooly/server.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/server.py 2009-03-23 21:57:31 UTC (rev 3205)
+++ mgmt/trunk/wooly/python/wooly/server.py 2009-03-24 17:35:17 UTC (rev 3206)
@@ -142,8 +142,8 @@
return (message,)
def send_response(self, response, headers, session, message):
- for name in session.cookies_by_name:
- headers.append(("Set-Cookie", session.marshal_cookie(name)))
+ for header in session.marshal_cookies():
+ headers.append(("Set-Cookie", header))
response(message, headers)
15 years, 9 months
rhmessaging commits: r3205 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-23 17:57:31 -0400 (Mon, 23 Mar 2009)
New Revision: 3205
Modified:
mgmt/trunk/wooly/python/wooly/pages.py
Log:
Header values are scalar now
Modified: mgmt/trunk/wooly/python/wooly/pages.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.py 2009-03-23 21:57:07 UTC (rev 3204)
+++ mgmt/trunk/wooly/python/wooly/pages.py 2009-03-23 21:57:31 UTC (rev 3205)
@@ -92,9 +92,9 @@
self.app.add_page(self.javascript_page)
def get_content_type(self, session):
- values = session.headers_by_name.get("user_agent")
+ value = session.headers_by_name.get("user_agent")
- if values and values[0].find("MSIE 6") != -1:
+ if value and value.find("MSIE 6") != -1:
content_type = self.html_content_type
else:
content_type = self.xhtml_content_type
15 years, 9 months
rhmessaging commits: r3204 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-23 17:57:07 -0400 (Mon, 23 Mar 2009)
New Revision: 3204
Modified:
mgmt/trunk/wooly/python/wooly/server.py
Log:
Set missing message
Modified: mgmt/trunk/wooly/python/wooly/server.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/server.py 2009-03-23 21:51:14 UTC (rev 3203)
+++ mgmt/trunk/wooly/python/wooly/server.py 2009-03-23 21:57:07 UTC (rev 3204)
@@ -133,6 +133,11 @@
session.headers_by_name[name] = value
def send_not_found(self, response, headers):
+ message = "404 Not Found"
+
+ headers.append(("Content-Length", str(len(message))))
+ headers.append(("Content-Type", "text/plain"))
+
response(message, headers)
return (message,)
15 years, 9 months
rhmessaging commits: r3203 - in mgmt/trunk: wooly/python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-23 17:51:14 -0400 (Mon, 23 Mar 2009)
New Revision: 3203
Modified:
mgmt/trunk/cumin/python/cumin/__init__.py
mgmt/trunk/wooly/python/wooly/__init__.py
mgmt/trunk/wooly/python/wooly/pages.py
mgmt/trunk/wooly/python/wooly/parameters.py
mgmt/trunk/wooly/python/wooly/server.py
Log:
Move the user-agent based content-type switching off of Page and to
HtmlPage. Get_content_type on Page now raises a not implemented
exception.
Refactor WebServer for clarity, and to make sure Session state is
always merged into the response before it is sent.
Adapt http request headers to the session, and store them there.
HtmlPage now uses that data to implement get_content_type.
Eliminate response headers on Session. We were using them for
cookies, and it's simpler and better to simply have a cookie store on
Session. Add a Session method to marshal a cookie.
Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py 2009-03-23 21:46:16 UTC (rev 3202)
+++ mgmt/trunk/cumin/python/cumin/__init__.py 2009-03-23 21:51:14 UTC (rev 3203)
@@ -95,7 +95,7 @@
if page in self.app.unprotected_pages:
return True
- id = session.cookies.get("session")
+ id = session.get_cookie("session")
if id is not None:
usess = self.app.user_sessions_by_id.get(id)
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-23 21:46:16 UTC (rev 3202)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-23 21:51:14 UTC (rev 3203)
@@ -332,9 +332,6 @@
self.redirect = Attribute(app, "redirect")
self.add_attribute(self.redirect)
- self.agent = Attribute(app, "agent")
- self.add_attribute(self.agent)
-
def init(self):
assert not self.sealed
assert self.parent is None
@@ -381,11 +378,7 @@
return datetime.utcnow()
def get_content_type(self, session):
- agent = self.agent.get(session)
- if self.name.endswith(".html") and (agent.find("MSIE 6") == -1):
- return self.xhtml_content_type
- else:
- return self.html_content_type
+ raise Exception("Not implemented")
def get_cache_control(self, session):
return None
@@ -469,20 +462,18 @@
class Session(object):
http_date_gmt = "%a, %d %b %Y %H:%M:%S GMT"
- def __init__(self, page, response_headers=None):
+ def __init__(self, page):
assert isinstance(page, Page)
self.app = page.app
self.page = page
self.trunk = None
- self.values = dict()
+
self.origin = None
- self.cookies = dict()
- if response_headers is None:
- self.response_headers = list()
- else:
- self.response_headers = response_headers
+ self.values_by_path = dict()
+ self.cookies_by_name = dict() # name => (value, expires)
+ self.headers_by_name = dict()
if self.app.debug:
self.debug = self.Debug(self)
@@ -512,29 +503,24 @@
def branch(self):
session = Session(self.page)
session.trunk = self
- session.response_headers = list(self.response_headers)
return session
- def add_header(self, name, value):
- self.response_headers.append((name, value))
+ def get_cookie(self, name):
+ try:
+ return self.cookies_by_name[name][0]
+ except KeyError:
+ pass
def set_cookie(self, name, value, expires=None):
- crumbs = list()
- crumbs.append("%s=%s" % (name, value))
+ self.cookies_by_name[name] = (value, expires)
- if expires:
- when = expires.strftime(self.http_date_gmt)
- crumbs.append("expires=%s" % when)
-
- self.add_header("Set-Cookie", "; ".join(crumbs))
-
def expire_cookie(self, name):
self.set_cookie(name, "", datetime(*gmtime(1)[0:6]))
# This is the biggest hotspot in cumin-bench profiling
def get(self, key):
- if key in self.values:
- value = self.values[key]
+ if key in self.values_by_path:
+ value = self.values_by_path[key]
elif self.trunk:
value = self.trunk.get(key)
else:
@@ -546,13 +532,13 @@
#if key.startswith("server.vhost.queue.edit.durable"):
# raise Exception()
- self.values[key] = value
+ self.values_by_path[key] = value
return value
def unset(self, key):
- if key in self.values:
- del self.values[key]
+ if key in self.values_by_path:
+ del self.values_by_path[key]
def marshal(self):
page = self.page.name
@@ -588,8 +574,8 @@
# Inlined below saving about a second in a
# 1000-hit profile
- if key in self.values:
- value = self.values[key]
+ if key in self.values_by_path:
+ value = self.values_by_path[key]
elif self.trunk:
value = self.trunk.get(key)
else:
@@ -646,17 +632,23 @@
except ValueError:
pass
- def unmarshal_cookies(self, string):
- if string is not None:
- cookies = dict()
- crumbs = string.split(";")
+ def marshal_cookie(self, name):
+ value, expires = self.cookies_by_name[name]
- for crumb in crumbs:
- name, value = crumb.split("=", 1)
- cookies[name.strip()] = value.strip()
+ crumbs = list()
+ crumbs.append("%s=%s" % (name, value))
- self.cookies = cookies
+ if expires:
+ when = expires.strftime(self.http_date_gmt)
+ crumbs.append("expires=%s" % when)
+ return "; ".join(crumbs)
+
+ def unmarshal_cookies(self, string):
+ for crumb in string.split(";"):
+ name, value = crumb.split("=", 1)
+ self.cookies_by_name[name.strip()] = (value.strip(), None)
+
def set_origin(self, origin):
self.origin = self.fix_origin(origin)
@@ -835,7 +827,7 @@
self.stack = stack
self.widget = widget
self.session = session
- self.session_values = copy(session.values)
+ self.session_values = copy(session.values_by_path)
self.object = object
self.caller = None
Modified: mgmt/trunk/wooly/python/wooly/pages.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.py 2009-03-23 21:46:16 UTC (rev 3202)
+++ mgmt/trunk/wooly/python/wooly/pages.py 2009-03-23 21:51:14 UTC (rev 3203)
@@ -91,6 +91,16 @@
self.javascript_page = JavascriptPage(app, name + ".js", self)
self.app.add_page(self.javascript_page)
+ def get_content_type(self, session):
+ values = session.headers_by_name.get("user_agent")
+
+ if values and values[0].find("MSIE 6") != -1:
+ content_type = self.html_content_type
+ else:
+ content_type = self.xhtml_content_type
+
+ return content_type
+
def enable_update(self, session, widget):
self.updates.get(session).append(widget)
Modified: mgmt/trunk/wooly/python/wooly/parameters.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/parameters.py 2009-03-23 21:46:16 UTC (rev 3202)
+++ mgmt/trunk/wooly/python/wooly/parameters.py 2009-03-23 21:51:14 UTC (rev 3203)
@@ -94,7 +94,7 @@
class VoidBooleanParameter(Parameter):
def get(self, session):
- return self.path in session.values
+ return self.path in session.values_by_path
def set(self, session, value):
key = self.path
Modified: mgmt/trunk/wooly/python/wooly/server.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/server.py 2009-03-23 21:46:16 UTC (rev 3202)
+++ mgmt/trunk/wooly/python/wooly/server.py 2009-03-23 21:51:14 UTC (rev 3203)
@@ -17,7 +17,7 @@
self.port = port
fqaddr = (self.addr, self.port)
- apps = [("", self.service)]
+ apps = [("", self.service_request)]
self.__server = CherryPyWSGIServer(fqaddr, apps)
def set_ssl_cert_path(self, path):
@@ -35,7 +35,7 @@
def authorized(self, session):
return False
- def service(self, env, respond):
+ def service_request(self, env, response):
headers = list()
name = env["PATH_INFO"][1:]
@@ -43,51 +43,29 @@
try:
page = self.app.pages_by_name[name]
except KeyError:
- return self.not_found(respond, headers)
+ return self.send_not_found(response, headers)
- session = Session(page, headers)
- session.unmarshal_url_vars(env["QUERY_STRING"])
+ session = Session(page)
- if "HTTP_USER_AGENT" in env:
- page.set_agent(session, env["HTTP_USER_AGENT"])
+ self.adapt_request_environment(env, session)
- if env["REQUEST_METHOD"] == "POST":
- if env["CONTENT_TYPE"] == "application/x-www-form-urlencoded":
- length = int(env["CONTENT_LENGTH"])
- vars = env["wsgi.input"].read(length)
- else:
- raise Exception("Content type '%s' is not supported" \
- % env["CONTENT_TYPE"])
-
- if vars:
- session.unmarshal_url_vars(vars, "&")
-
- try:
- session.unmarshal_cookies(env["HTTP_COOKIE"])
- except KeyError:
- pass
-
- if "HTTP_REFERER" in env:
- # XXX set this on page instead
- session.set_origin(env["HTTP_REFERER"])
-
if not self.authorized(session):
url = page.get_redirect_url(session)
if url:
- return self.redirect(respond, headers, url)
+ return self.send_redirect(response, headers, session, url)
else:
- return self.unauthorized(respond, headers)
+ return self.send_unauthorized(response, headers, session)
try:
page.process(session)
except:
- return self.error(respond, session)
+ return self.send_error(response, headers, session)
url = page.get_redirect_url(session)
if url:
- return self.redirect(respond, headers, url)
+ return self.send_redirect(response, headers, session, url)
ims = env.get("HTTP_IF_MODIFIED_SINCE")
modified = page.get_last_modified(session).replace(microsecond=0)
@@ -96,11 +74,11 @@
since = datetime(*strptime(str(ims), self.http_date)[0:6])
if modified <= since:
- return self.not_modified(respond, headers)
+ return self.send_not_modified(response, headers, session)
if modified:
- ts = modified.strftime(self.http_date_gmt)
- headers.append(("Last-Modified", ts))
+ when = modified.strftime(self.http_date_gmt)
+ headers.append(("Last-Modified", when))
type = page.get_content_type(session)
@@ -113,51 +91,88 @@
headers.append(("Cache-Control", cache))
try:
- response = page.render(session)
+ content = page.render(session)
except:
- return self.error(respond, session)
+ return self.send_error(response, headers, session)
- headers.append(("Content-Length", str(len(response))))
+ headers.append(("Content-Length", str(len(content))))
- respond("200 OK", headers)
+ self.send_response(response, headers, session, "200 OK")
page.save_session(session)
- return (response,)
+ return (content,)
- def message(self, respond, headers, message):
+ def adapt_request_environment(self, env, session):
+ session.unmarshal_url_vars(env["QUERY_STRING"])
+
+ if env["REQUEST_METHOD"] == "POST":
+ content_type = env["CONTENT_TYPE"]
+
+ if content_type == "application/x-www-form-urlencoded":
+ length = int(env["CONTENT_LENGTH"])
+ vars = env["wsgi.input"].read(length)
+ else:
+ raise Exception \
+ ("Content type '%s' is not supported" % content_type)
+
+ if vars:
+ session.unmarshal_url_vars(vars, "&")
+
+ try:
+ session.unmarshal_cookies(env["HTTP_COOKIE"])
+ except KeyError:
+ pass
+
+ # XXX set this on page instead
+ session.set_origin(env.get("HTTP_REFERER"))
+
+ for key, value in env.iteritems():
+ if key.startswith("HTTP_"):
+ name = key[5:].lower()
+ session.headers_by_name[name] = value
+
+ def send_not_found(self, response, headers):
+ response(message, headers)
+ return (message,)
+
+ def send_response(self, response, headers, session, message):
+ for name in session.cookies_by_name:
+ headers.append(("Set-Cookie", session.marshal_cookie(name)))
+
+ response(message, headers)
+
+ def send_message(self, response, headers, session, message):
headers.append(("Content-Length", str(len(message))))
headers.append(("Content-Type", "text/plain"))
- respond(message, headers)
+ self.send_response(response, headers, session, message)
return (message,)
- def not_found(self, respond, headers):
- return self.message(respond, headers, "404 Not Found")
+ def send_unauthorized(self, response, headers, session):
+ return self.send_message \
+ (response, headers, session, "401 Unauthorized")
- def unauthorized(self, respond, headers):
- return self.message(respond, headers, "401 Unauthorized")
-
- def redirect(self, respond, headers, url):
+ def send_redirect(self, response, headers, session, url):
headers.append(("Location", url))
headers.append(("Content-Length", "0"))
- respond("303 See Other", headers)
+ self.send_response(response, headers, session, "303 See Other")
return ()
- def not_modified(self, respond, headers):
+ def send_not_modified(self, response, headers, session):
headers.append(("Content-Length", "0"))
- respond("304 Not Modified", headers)
+ self.send_response(response, headers, session, "304 Not Modified")
return ()
- def error(self, respond, session):
- session.add_header("Content-Type", "text/plain")
+ def send_error(self, response, headers, session):
+ headers.append(("Content-Type", "text/plain"))
- respond("500 Error", session.response_headers)
+ self.send_response(response, headers, session)
writer = Writer()
writer.write("APPLICATION ERROR\n")
15 years, 9 months
rhmessaging commits: r3202 - mgmt/trunk/basil/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-23 17:46:16 -0400 (Mon, 23 Mar 2009)
New Revision: 3202
Modified:
mgmt/trunk/basil/bin/basil
Log:
Use a normal shebang path
Modified: mgmt/trunk/basil/bin/basil
===================================================================
--- mgmt/trunk/basil/bin/basil 2009-03-23 17:17:40 UTC (rev 3201)
+++ mgmt/trunk/basil/bin/basil 2009-03-23 21:46:16 UTC (rev 3202)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python
import sys, os
15 years, 9 months
rhmessaging commits: r3201 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-23 13:17:40 -0400 (Mon, 23 Mar 2009)
New Revision: 3201
Modified:
mgmt/trunk/cumin/python/cumin/page.py
Log:
Use ModeSet's render, not CuminPage's
Modified: mgmt/trunk/cumin/python/cumin/page.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.py 2009-03-23 17:16:53 UTC (rev 3200)
+++ mgmt/trunk/cumin/python/cumin/page.py 2009-03-23 17:17:40 UTC (rev 3201)
@@ -32,6 +32,9 @@
def render_title(self, session):
return "MRG Management"
+ def render_content(self, session):
+ return self.render_mode(session)
+
class MainFrame(CuminFrame):
def __init__(self, app, name):
super(MainFrame, self).__init__(app, name)
15 years, 9 months
rhmessaging commits: r3200 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-23 13:16:53 -0400 (Mon, 23 Mar 2009)
New Revision: 3200
Modified:
mgmt/trunk/wooly/python/wooly/__init__.py
Log:
In debug mode, annotate the rendered html with comments about which widget did what
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-23 16:51:46 UTC (rev 3199)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-23 17:16:53 UTC (rev 3200)
@@ -257,6 +257,12 @@
if session.debug:
call.close()
+ if self.parent:
+ cls = self.__class__
+ name = self.__repr__()
+ string = "<!-- \nopen: %s\n -->%s<!-- \nclose: %s\n -->" % \
+ (name, string, name)
+
return string
def do_render(self, session, *args):
@@ -291,7 +297,8 @@
print " %-30s %s" % (key + ":", value)
def __repr__(self):
- return "%s('%s')" % (self.__class__.__name__, self.path)
+ return "%s.%s('%s')" % \
+ (self.__class__.__module__, self.__class__.__name__, self.path)
class Frame(Widget):
def show(self, session):
15 years, 9 months
rhmessaging commits: r3199 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-03-23 12:51:46 -0400 (Mon, 23 Mar 2009)
New Revision: 3199
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
Log:
Correction to logic for management txn depth monitoring
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2009-03-23 15:17:27 UTC (rev 3198)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2009-03-23 16:51:46 UTC (rev 3199)
@@ -367,7 +367,7 @@
if (_mgmtObject != 0)
{
- if (txn_incr)
+ if (!txn_incr) // If this xid was not in _tmap, it will be now...
_mgmtObject->inc_txn();
_mgmtObject->inc_enqueues();
_mgmtObject->inc_txnEnqueues();
@@ -385,7 +385,7 @@
if (_mgmtObject != 0)
{
- if (txn_incr)
+ if (!txn_incr) // If this xid was not in _tmap, it will be now...
_mgmtObject->inc_txn();
_mgmtObject->inc_enqueues();
_mgmtObject->inc_txnEnqueues();
@@ -409,10 +409,14 @@
void
JournalImpl::dequeue_txn_data_record(data_tok* const dtokp, const std::string& xid, const bool txn_coml_commit)
{
+ bool txn_incr = _mgmtObject != 0 ? _tmap.in_map(xid) : false;
+
handleIoResult(jcntl::dequeue_txn_data_record(dtokp, xid, txn_coml_commit));
if (_mgmtObject != 0)
{
+ if (!txn_incr) // If this xid was not in _tmap, it will be now...
+ _mgmtObject->inc_txn();
_mgmtObject->inc_dequeues();
_mgmtObject->inc_txnDequeues();
_mgmtObject->dec_recordDepth();
15 years, 9 months
rhmessaging commits: r3198 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-23 11:17:27 -0400 (Mon, 23 Mar 2009)
New Revision: 3198
Modified:
mgmt/trunk/wooly/python/wooly/pages.strings
Log:
Restore .js target
Modified: mgmt/trunk/wooly/python/wooly/pages.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.strings 2009-03-23 14:51:38 UTC (rev 3197)
+++ mgmt/trunk/wooly/python/wooly/pages.strings 2009-03-23 15:17:27 UTC (rev 3198)
@@ -16,6 +16,7 @@
<script type="text/javascript" src="resource?name=wooly.js"> </script>
<script type="text/javascript" src="resource?name=app.js"> </script>
+ <script type="text/javascript" src="{id}.js"> </script>
{update_script}
</head>
<body class="{class}">
15 years, 9 months